From 04c8124f3991dea550d87d7bec73416262ffd3da Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Mon, 6 Dec 2010 12:34:19 +1300 Subject: [PATCH] BUGFIX Check for existence of REQUEST_URI IN Director::forceSSL() and Director::absoluteURL() (forceSSL() is typically called in _config.php, which fails when executed through cli-script.php) --- core/control/Director.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/control/Director.php b/core/control/Director.php index 44a8b0134..472152feb 100755 --- a/core/control/Director.php +++ b/core/control/Director.php @@ -337,6 +337,8 @@ class Director { * @todo Document how relativeToSiteBase works */ static function absoluteURL($url, $relativeToSiteBase = false) { + if(!isset($_SERVER['REQUEST_URI'])) return false; + if(strpos($url,'/') === false && !$relativeToSiteBase) $url = dirname($_SERVER['REQUEST_URI'] . 'x') . '/' . $url; if(substr($url,0,4) != "http") { @@ -615,6 +617,8 @@ class Director { * @return boolean|string String of URL when unit tests running, boolean FALSE if patterns don't match request URI */ static function forceSSL($patterns = null) { + if(!isset($_SERVER['REQUEST_URI'])) return false; + $matched = false; if($patterns) {