From: Matthias Schmidt Date: Mon, 19 Aug 2019 16:28:19 +0000 (+0200) Subject: Use relative paths in writability check error message X-Git-Tag: 5.2.0_Beta_2~28^2~1 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=7f754c71237911cd06845f1d7d3758f03d8f346e;p=GitHub%2FWoltLab%2FWCF.git Use relative paths in writability check error message --- diff --git a/wcfsetup/install/files/lib/system/WCF.class.php b/wcfsetup/install/files/lib/system/WCF.class.php index 07ad27a9df..05d9510bb9 100644 --- a/wcfsetup/install/files/lib/system/WCF.class.php +++ b/wcfsetup/install/files/lib/system/WCF.class.php @@ -1151,18 +1151,18 @@ class WCF { } if (!is_writable($path)) { - $nonWritablePaths[] = $path; + $nonWritablePaths[] = FileUtil::getRelativePath($_SERVER['DOCUMENT_ROOT'], $path); continue; } DirectoryUtil::getInstance($path, false)->executeCallback(function($file, \SplFileInfo $fileInfo) use ($path, &$nonWritablePaths) { if ($fileInfo instanceof \DirectoryIterator) { if (!is_writable($fileInfo->getPath())) { - $nonWritablePaths[] = $fileInfo->getPath(); + $nonWritablePaths[] = FileUtil::getRelativePath($_SERVER['DOCUMENT_ROOT'], $fileInfo->getPath()); } } else if (!is_writable($fileInfo->getRealPath())) { - $nonWritablePaths[] = $fileInfo->getRealPath(); + $nonWritablePaths[] = FileUtil::getRelativePath($_SERVER['DOCUMENT_ROOT'], $fileInfo->getPath()) . $fileInfo->getFilename(); } }); } @@ -1182,18 +1182,18 @@ class WCF { $path = WCF_DIR . $directory; if (!is_writable($path)) { - $nonWritablePaths[] = $path; + $nonWritablePaths[] = FileUtil::getRelativePath($_SERVER['DOCUMENT_ROOT'], $path); continue; } DirectoryUtil::getInstance($path)->executeCallback(function($file, \SplFileInfo $fileInfo) use ($path, &$nonWritablePaths) { if ($fileInfo instanceof \DirectoryIterator) { if (!is_writable($fileInfo->getPath())) { - $nonWritablePaths[] = $fileInfo->getPath(); + $nonWritablePaths[] = FileUtil::getRelativePath($_SERVER['DOCUMENT_ROOT'], $fileInfo->getPath()); } } else if (!is_writable($fileInfo->getRealPath())) { - $nonWritablePaths[] = $fileInfo->getRealPath(); + $nonWritablePaths[] = FileUtil::getRelativePath($_SERVER['DOCUMENT_ROOT'], $fileInfo->getPath()) . $fileInfo->getFilename(); } }); }