summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLoui Chang <louipc.ist@gmail.com>2008-09-12 20:19:42 -0400
committerLoui Chang <louipc.ist@gmail.com>2008-09-21 20:10:50 -0400
commit5c3f01909301f641f57b2ffe8b59609de6be2256 (patch)
tree8c78aa341237ca6195ac5330838dab1fda22f181
parent99881b31db85bcb87bec22258d856521e5bef7ed (diff)
downloadaurweb-5c3f01909301f641f57b2ffe8b59609de6be2256.tar.xz
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 <louipc.ist@gmail.com>
-rw-r--r--web/lib/aur.inc15
1 files changed, 3 insertions, 12 deletions
diff --git a/web/lib/aur.inc b/web/lib/aur.inc
index ade5b82..a126bb9 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;
}