From 936e60089a122b4c643e8fc81c50a668fd939d60 Mon Sep 17 00:00:00 2001 From: phl0 Date: Thu, 16 Nov 2023 09:36:56 +0100 Subject: [PATCH] We should only check directories for being writable --- application/controllers/Debug.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/application/controllers/Debug.php b/application/controllers/Debug.php index 5d8d2a9c..1d60cbd5 100644 --- a/application/controllers/Debug.php +++ b/application/controllers/Debug.php @@ -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;