From 986d95b31eeb4a56cb39f308b1e5a5aac2b2d04b Mon Sep 17 00:00:00 2001 From: Francois Marier Date: Thu, 20 Aug 2009 17:46:26 +1200 Subject: 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 --- lib/common.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') 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; } -- cgit v1.2.3-54-g00ecf