diff --git a/ext/regen_thumb/main.php b/ext/regen_thumb/main.php index b5352cd1..859d7fa4 100644 --- a/ext/regen_thumb/main.php +++ b/ext/regen_thumb/main.php @@ -152,7 +152,7 @@ class RegenThumb extends Extension $page->flash("Deleted $i thumbnails for ".$_POST["delete_thumb_mime"]." images"); } else { $dir = "data/thumbs/"; - $this->remove_dir_recursively($dir); + deltree($dir); $page->flash("Deleted all thumbnails"); } @@ -174,22 +174,4 @@ class RegenThumb extends Extension return $database->get_all($query, $args); } - - public function remove_dir_recursively($dir) - { - if (is_dir($dir)) { - $objects = scandir($dir); - foreach ($objects as $object) { - if ($object != "." && $object != "..") { - if (filetype($dir."/".$object) == "dir") { - $this->remove_dir_recursively($dir."/".$object); - } else { - unlink($dir."/".$object); - } - } - } - reset($objects); - rmdir($dir); - } - } }