]> gitweb.fluxo.info Git - semanticscuttle.git/commitdiff
Bug fix: correct ROOT declaration
authormensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>
Wed, 3 Dec 2008 10:06:02 +0000 (10:06 +0000)
committermensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>
Wed, 3 Dec 2008 10:06:02 +0000 (10:06 +0000)
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@187 b3834d28-1941-0410-a4f8-b48e95affb8f

constants.inc.php

index 23dcc4a9a35526b01134c22c961de12a0b0668c0..80781413eef48be8a66b83dff23fbc92c4d2ad77 100644 (file)
@@ -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