aboutsummaryrefslogtreecommitdiffstats
path: root/inc/lib_base.php
diff options
context:
space:
mode:
Diffstat (limited to 'inc/lib_base.php')
-rwxr-xr-xinc/lib_base.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/inc/lib_base.php b/inc/lib_base.php
index 0e12a0bacf3..aa14d3cec00 100755
--- a/inc/lib_base.php
+++ b/inc/lib_base.php
@@ -33,11 +33,12 @@ session_start();
// calculate the documentroot
$SERVERROOT=substr(__FILE__,0,-17);
-$DOCUMENTROOT=$_SERVER['DOCUMENT_ROOT'];
+$DOCUMENTROOT=realpath($_SERVER['DOCUMENT_ROOT']);
$SERVERROOT=str_replace("\\",'/',$SERVERROOT);
-$SUBURI=substr($_SERVER["SCRIPT_FILENAME"],strlen($SERVERROOT));
+$SUBURI=substr(realpath($_SERVER["SCRIPT_FILENAME"]),strlen($SERVERROOT));
$WEBROOT=substr($_SERVER["SCRIPT_NAME"],0,strlen($_SERVER["SCRIPT_NAME"])-strlen($SUBURI));
+
if($WEBROOT!='' and $WEBROOT[0]!=='/'){
$WEBROOT='/'.$WEBROOT;
}