summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLoui Chang <louipc.ist@gmail.com>2008-09-13 02:19:42 +0200
committerLoui Chang <louipc.ist@gmail.com>2008-09-22 02:10:50 +0200
commit5c3f01909301f641f57b2ffe8b59609de6be2256 (patch)
tree8c78aa341237ca6195ac5330838dab1fda22f181
parent99881b31db85bcb87bec22258d856521e5bef7ed (diff)
downloadaur-5c3f01909301f641f57b2ffe8b59609de6be2256.tar.gz
aur-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 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;
}