summaryrefslogtreecommitdiff
path: root/inc/init.php
diff options
context:
space:
mode:
Diffstat (limited to 'inc/init.php')
-rw-r--r--inc/init.php4
1 files changed, 4 insertions, 0 deletions
diff --git a/inc/init.php b/inc/init.php
index d3379565c..58dc5c67d 100644
--- a/inc/init.php
+++ b/inc/init.php
@@ -95,6 +95,10 @@ function getBaseURL($abs=false){
if($conf['basedir']){
$dir = $conf['basedir'];
+ }elseif($_SERVER['DOCUMENT_ROOT'] && $_SERVER['SCRIPT_FILENAME']){
+ $dir = preg_replace ('/^'.preg_quote($_SERVER['DOCUMENT_ROOT'],'/').'/','',
+ $_SERVER['SCRIPT_FILENAME']);
+ $dir = dirname('/'.$dir).'/';
}else{
$dir = dirname($_SERVER['PHP_SELF']).'/';
}