// Fixed deleteDirectory function (is_dir is cached and must not be used, because use the result of scandir)
This commit is contained in:
+1
-2
@@ -669,8 +669,7 @@ class ToolsCore
|
|||||||
public static function deleteDirectory($dirname, $delete_self = true)
|
public static function deleteDirectory($dirname, $delete_self = true)
|
||||||
{
|
{
|
||||||
$dirname = rtrim($dirname, '/').'/';
|
$dirname = rtrim($dirname, '/').'/';
|
||||||
$files = scandir($dirname);
|
if ($files = scandir($dirname))
|
||||||
if (is_dir($dirname))
|
|
||||||
{
|
{
|
||||||
foreach ($files as $file)
|
foreach ($files as $file)
|
||||||
if ($file != '.' && $file != '..' && $file != '.svn')
|
if ($file != '.' && $file != '..' && $file != '.svn')
|
||||||
|
|||||||
@@ -655,9 +655,8 @@ class AdminTranslationsControllerCore extends AdminController
|
|||||||
elseif (!preg_match('@^[0-9a-z-_/\\\\]+\.(html|tpl|txt)$@i', $file2check['filename']))
|
elseif (!preg_match('@^[0-9a-z-_/\\\\]+\.(html|tpl|txt)$@i', $file2check['filename']))
|
||||||
$this->errors[] = sprintf(Tools::displayError('Unidentified file found: %s'), $file2check['filename']);
|
$this->errors[] = sprintf(Tools::displayError('Unidentified file found: %s'), $file2check['filename']);
|
||||||
}
|
}
|
||||||
|
Tools::deleteDirectory($sandbox, true);
|
||||||
}
|
}
|
||||||
Tools::deleteDirectory($sandbox, true);
|
|
||||||
|
|
||||||
if (count($this->errors))
|
if (count($this->errors))
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user