From 5049a877378f374dbb1eb514c22b6f0c0e77cd12 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Wed, 14 Apr 2010 03:47:57 +0000 Subject: [PATCH] BUGFIX Fixed strpos() check in BASE_URL check (from r98897) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@102812 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- core/Core.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/Core.php b/core/Core.php index 883797ee4..ee2d7ab51 100755 --- a/core/Core.php +++ b/core/Core.php @@ -134,7 +134,7 @@ if(!defined('BASE_URL')) { // If that didn't work, failover to the old syntax. Hopefully this isn't necessary, and maybe // if can be phased out? if(!defined('BASE_URL')) { - $dir = strpos($_SERVER['SCRIPT_NAME'], 'index.php') + $dir = strpos($_SERVER['SCRIPT_NAME'], 'index.php') !== false ? dirname($_SERVER['SCRIPT_NAME']) : dirname(dirname($_SERVER['SCRIPT_NAME'])); define('BASE_URL', rtrim($dir, DIRECTORY_SEPARATOR));