mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
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)
This commit is contained in:
parent
a7e9be3bc4
commit
04c8124f39
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user