Merge pull request #2699 from phl0/checkOnlyDirectories

We should only check directories for being writable
This commit is contained in:
Peter Goodhall 2023-11-16 11:02:49 +00:00 committed by GitHub
commit 99e948a144
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -52,9 +52,11 @@ class Debug extends CI_Controller {
// Check if the subdirectories are writable (recursive check)
$iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path));
foreach ($iterator as $item) {
if (!is_writable($item->getPathname())) {
return false;
}
if ($item->isDir() && basename($item->getPathName()) != '..') {
if (!is_writable($item->getRealPath())) {
return false;
}
}
}
return true;