// 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 .'/';
}
}
}
define('ROOT', 'http://'. $_SERVER['HTTP_HOST'] . $rootTmp);
+} else {
+ define('ROOT', $GLOBALS['root']);
}
// Error codes