From c60c19f81458f6d150202ac9a772dfaf942af355 Mon Sep 17 00:00:00 2001 From: mensonge Date: Wed, 3 Dec 2008 10:06:02 +0000 Subject: Bug fix: correct ROOT declaration git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@187 b3834d28-1941-0410-a4f8-b48e95affb8f --- constants.inc.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/constants.inc.php b/constants.inc.php index 23dcc4a..8078141 100644 --- a/constants.inc.php +++ b/constants.inc.php @@ -13,9 +13,11 @@ if(isset($GLOBALS['debugMode'])) { // Determine the base URL as ROOT if (!isset($GLOBALS['root'])) { $pieces = explode('/', $_SERVER['SCRIPT_NAME']); + $rootTmp = '/'; foreach($pieces as $piece) { - if ($piece != '' && !strstr($piece, '.php')) { + //we eliminate possible sscuttle subfolders (like gsearch for example) + if ($piece != '' && !strstr($piece, '.php') && $piece != 'gsearch') { $rootTmp .= $piece .'/'; } } @@ -24,6 +26,8 @@ if (!isset($GLOBALS['root'])) { } define('ROOT', 'http://'. $_SERVER['HTTP_HOST'] . $rootTmp); +} else { + define('ROOT', $GLOBALS['root']); } // Error codes -- cgit v1.2.3