Skip to content
Snippets Groups Projects
Commit 25360370 authored by Frédéric Carretero's avatar Frédéric Carretero
Browse files

Correction dans la méthode "Local_files::clearDir"

parent 633acb1f
Branches
Tags
No related merge requests found
......@@ -266,26 +266,26 @@ class Local_files implements Files{
*@return boolean true if it's ok, false else.
*/
public function clearDir($sDirPath){
$ouverture = @opendir($sDossier);
$ouverture = @opendir($sDirPath);
if (!$ouverture)
return;
while ($sFichier = readdir($ouverture)) {
if ($sFichier == '.' || $sFichier == '..')
continue;
if ($this->is_dir($sDossier . "/" . $sFichier)) {
$bCleared = $this->clearDir($sDossier . "/" . $sFichier);
if ($this->is_dir($sDirPath . "/" . $sFichier)) {
$bCleared = $this->clearDir($sDirPath . "/" . $sFichier);
if (!$bCleared)
return false;
}
else {
$bCleared = @unlink($sDossier . "/" . $sFichier);
$bCleared = @unlink($sDirPath . "/" . $sFichier);
if (!$bCleared)
return false;
}
}
closedir($ouverture);
$bCleared = @rmdir($sDossier);
$bCleared = @rmdir($sDirPath);
if (!$bCleared)
return false;
return true;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment