]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Fix the default value of ['server']['path'] when running from command line scripts
authorFrancois Marier <francois@debian.org>
Thu, 20 Aug 2009 05:46:26 +0000 (17:46 +1200)
committerFrancois Marier <francois@debian.org>
Thu, 20 Aug 2009 05:46:26 +0000 (17:46 +1200)
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

lib/common.php

index 3fc047af94093d90ab955252ca6ca8466ed2f5f5..6c4b856e00d91e1ccba9b2fb0334b566694b4c00 100644 (file)
@@ -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;
 }