From 5c3f01909301f641f57b2ffe8b59609de6be2256 Mon Sep 17 00:00:00 2001 From: Loui Chang Date: Fri, 12 Sep 2008 20:19:42 -0400 Subject: Use system rm in rm_rf function. PHP can't properly handle symlinks which causes problems when self-referencing symlinks appear. This closes FS#11187. Signed-off-by: Loui Chang --- web/lib/aur.inc | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'web') diff --git a/web/lib/aur.inc b/web/lib/aur.inc index ade5b82c..a126bb94 100644 --- a/web/lib/aur.inc +++ b/web/lib/aur.inc @@ -374,19 +374,10 @@ function can_submit_pkg($name="", $sid="") { # recursive delete directory # function rm_rf($dirname="") { - $d = dir($dirname); - while ($f = $d->read()) { - if ($f != "." && $f != "..") { - if (is_dir($dirname."/".$f)) { - rm_rf($dirname."/".$f); - } - if (is_file($dirname."/".$f) || is_link($dirname."/".$f)) { - unlink($dirname."/".$f); - } - } + if ($dirname != "") { + exec('rm -rf ' . escapeshellcmd($dirname)); } - $d->close(); - rmdir($dirname); + return; } -- cgit v1.2.3-24-g4f1b