From 7f754c71237911cd06845f1d7d3758f03d8f346e Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Mon, 19 Aug 2019 18:28:19 +0200 Subject: [PATCH] Use relative paths in writability check error message --- wcfsetup/install/files/lib/system/WCF.class.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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(); } }); } -- 2.20.1