Use relative paths in writability check error message
authorMatthias Schmidt <gravatronics@live.com>
Mon, 19 Aug 2019 16:28:19 +0000 (18:28 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Mon, 19 Aug 2019 16:28:19 +0000 (18:28 +0200)
wcfsetup/install/files/lib/system/WCF.class.php

index 07ad27a9df9e3ba85d27603d139cf75b95a20466..05d9510bb96f76da801e0795c777a87b0a30ebd5 100644 (file)
@@ -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();
                                }
                        });
                }