summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorFrancois Marier <francois@debian.org>2009-08-20 17:46:26 +1200
committerFrancois Marier <francois@debian.org>2009-08-20 17:46:26 +1200
commit986d95b31eeb4a56cb39f308b1e5a5aac2b2d04b (patch)
tree3adeadbb573d70e54b5c271048495a8d281812fc /lib
parentd647483a27faad7bf5297255a68b6b3b82426b88 (diff)
Fix the default value of ['server']['path'] when running from command line scripts
The logic in _sn_to_path() doesn't make sense when not running via a remote server. Default to the empty string if running from the command line and ['server']['path'] is not set manually in config.php
Diffstat (limited to 'lib')
-rw-r--r--lib/common.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/common.php b/lib/common.php
index 3fc047af9..6c4b856e0 100644
--- a/lib/common.php
+++ b/lib/common.php
@@ -82,7 +82,7 @@ if (isset($server)) {
if (isset($path)) {
$_path = $path;
} else {
- $_path = array_key_exists('SCRIPT_NAME', $_SERVER) ?
+ $_path = (array_key_exists('SERVER_NAME', $_SERVER) && array_key_exists('SCRIPT_NAME', $_SERVER)) ?
_sn_to_path($_SERVER['SCRIPT_NAME']) :
null;
}