// Fixed deleteDirectory function (is_dir is cached and must not be used, because use the result of scandir)

This commit is contained in:
Damien Metzger
2012-12-28 09:47:09 +01:00
parent 321eaa191b
commit 7bebdb5eb5
2 changed files with 2 additions and 4 deletions
+1 -2
View File
@@ -669,8 +669,7 @@ class ToolsCore
public static function deleteDirectory($dirname, $delete_self = true)
{
$dirname = rtrim($dirname, '/').'/';
$files = scandir($dirname);
if (is_dir($dirname))
if ($files = scandir($dirname))
{
foreach ($files as $file)
if ($file != '.' && $file != '..' && $file != '.svn')