Bug fix: correct ROOT declaration
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@187 b3834d28-1941-0410-a4f8-b48e95affb8f
This commit is contained in:
parent
066fb4e8e3
commit
c60c19f814
1 changed files with 5 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue