summaryrefslogtreecommitdiffstats
path: root/inc
diff options
context:
space:
mode:
authorRobin Appelman <icewind1991@gmail.com>2010-06-27 18:09:59 +0200
committerRobin Appelman <icewind1991@gmail.com>2010-06-27 18:09:59 +0200
commit0ba0f226276c72b5c7b5ce8fc6e025da347fd178 (patch)
tree9d1522de2d17ab57abf337d7e098235c591a458a /inc
parenta0088cfea61f7964f92ab4c576ce19f523abc5cb (diff)
downloadnextcloud-server-0ba0f226276c72b5c7b5ce8fc6e025da347fd178.tar.gz
nextcloud-server-0ba0f226276c72b5c7b5ce8fc6e025da347fd178.zip
fix webroot when using symlinks
Diffstat (limited to 'inc')
-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;
}