From 3f47ee740d48b13216d9e3cd6ca71fda5d93e553 Mon Sep 17 00:00:00 2001 From: mickael9 Date: Sat, 5 Jun 2010 00:50:18 -0400 Subject: pkgsubmit: store the previous path with getcwd() This solves the problem of include files not being found after an error. $_SERVER['DOCUMENT_ROOT'] is not reliable because the AUR might be installed in a subdirectory. This closes http://bugs.archlinux.org/task/16887 Signed-off-by: Loui Chang --- web/html/pkgsubmit.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/web/html/pkgsubmit.php b/web/html/pkgsubmit.php index a413a07..0b9335b 100644 --- a/web/html/pkgsubmit.php +++ b/web/html/pkgsubmit.php @@ -12,6 +12,8 @@ include_once("pkgfuncs.inc"); # package functions set_lang(); # this sets up the visitor's language check_sid(); # see if they're still logged in +$cwd = getcwd(); + if ($_COOKIE["AURSID"]): # Track upload errors @@ -421,7 +423,7 @@ if ($_COOKIE["AURSID"]): } } - chdir($_SERVER['DOCUMENT_ROOT']); + chdir($cwd); } # Logic over, let's do some output -- cgit v1.2.3-70-g09d2