This reverts commit 5c3f01909301f641f57b2ffe8b59609de6be2256. Falling back
to a system function is really dumb when all we need to do is fix the
ordering of things in this function.

Signed-off-by: Dan McGee <[EMAIL PROTECTED]>
---

Guys,

I sent the last patches based off of the master branch- looks like I have no
idea how your development works, sorry about that. Anyway here is the series
based off of the testing branch. It still will need some testing.

-Dan

 web/lib/aur.inc |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/web/lib/aur.inc b/web/lib/aur.inc
index a126bb9..ade5b82 100644
--- a/web/lib/aur.inc
+++ b/web/lib/aur.inc
@@ -374,10 +374,19 @@ function can_submit_pkg($name="", $sid="") {
 # recursive delete directory
 #
 function rm_rf($dirname="") {
-       if ($dirname != "") {
-               exec('rm -rf ' . escapeshellcmd($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);
+                       }
+               }
        }
-
+       $d->close();
+       rmdir($dirname);
        return;
 }
 
-- 
1.6.0.3

Reply via email to