diff --git a/system/Commands/Housekeeping/ClearDebugbar.php b/system/Commands/Housekeeping/ClearDebugbar.php index 2a5c9fa4b536..dd49b24a7656 100644 --- a/system/Commands/Housekeeping/ClearDebugbar.php +++ b/system/Commands/Housekeeping/ClearDebugbar.php @@ -57,7 +57,7 @@ public function run(array $params) { helper('filesystem'); - if (! delete_files(WRITEPATH . 'debugbar')) { + if (! delete_files(WRITEPATH . 'debugbar', false, true)) { // @codeCoverageIgnoreStart CLI::error('Error deleting the debugbar JSON files.'); CLI::newLine(); diff --git a/tests/system/Commands/ClearDebugbarTest.php b/tests/system/Commands/ClearDebugbarTest.php index d55988996ee8..1e86406f7054 100644 --- a/tests/system/Commands/ClearDebugbarTest.php +++ b/tests/system/Commands/ClearDebugbarTest.php @@ -61,7 +61,7 @@ public function testClearDebugbarWorks(): void $result = $this->getStreamFilterBuffer(); $this->assertFileDoesNotExist(WRITEPATH . 'debugbar' . DIRECTORY_SEPARATOR . "debugbar_{$this->time}.json"); - $this->assertFileExists(WRITEPATH . 'debugbar' . DIRECTORY_SEPARATOR . '.gitkeep'); + $this->assertFileExists(WRITEPATH . 'debugbar' . DIRECTORY_SEPARATOR . 'index.html'); $this->assertStringContainsString('Debugbar cleared.', $result); } } diff --git a/writable/index.html b/writable/index.html new file mode 100755 index 000000000000..b702fbc3967b --- /dev/null +++ b/writable/index.html @@ -0,0 +1,11 @@ + + +
+Directory access is forbidden.
+ + +