aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--constants.inc.php6
1 files changed, 5 insertions, 1 deletions
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