From: Francois Marier Date: Thu, 20 Aug 2009 05:46:26 +0000 (+1200) Subject: Fix the default value of ['server']['path'] when running from command line scripts X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=986d95b31eeb4a56cb39f308b1e5a5aac2b2d04b;p=quix0rs-gnu-social.git 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 --- diff --git a/lib/common.php b/lib/common.php index 3fc047af94..6c4b856e00 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; }