summaryrefslogtreecommitdiffstats
path: root/web/html/pkgsubmit.php
diff options
context:
space:
mode:
authormickael9 <mickael9@gmail.com>2010-06-05 00:50:18 -0400
committerLoui Chang <louipc.ist@gmail.com>2010-06-05 00:56:33 -0400
commit3f47ee740d48b13216d9e3cd6ca71fda5d93e553 (patch)
tree29ae3ee5841e3c54babada45d20760b7c6fac69e /web/html/pkgsubmit.php
parentb18fb08ddc7201760112f4492cdcd81961902fa1 (diff)
downloadaurweb-3f47ee740d48b13216d9e3cd6ca71fda5d93e553.tar.xz
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 <louipc.ist@gmail.com>
Diffstat (limited to 'web/html/pkgsubmit.php')
-rw-r--r--web/html/pkgsubmit.php4
1 files changed, 3 insertions, 1 deletions
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