]> source.dussan.org Git - nextcloud-server.git/commitdiff
Use __DIR__ instead of __FILE__ to get SERVERROOT
authorBart Visscher <bartv@thisnet.nl>
Fri, 28 Sep 2012 13:29:41 +0000 (15:29 +0200)
committerBart Visscher <bartv@thisnet.nl>
Wed, 10 Oct 2012 19:06:15 +0000 (21:06 +0200)
lib/base.php

index 21b7165e5e83ce2acbbc20219d7781866265a3e4..50f113543c4a5f5953721f285982685c57014add 100644 (file)
@@ -104,7 +104,7 @@ class OC{
 
        public static function initPaths() {
                // calculate the root directories
-               OC::$SERVERROOT=str_replace("\\", '/', substr(__FILE__, 0, -13));
+               OC::$SERVERROOT=str_replace("\\", '/', substr(__DIR__, 0, -4));
                OC::$SUBURI= str_replace("\\", "/", substr(realpath($_SERVER["SCRIPT_FILENAME"]), strlen(OC::$SERVERROOT)));
                $scriptName=$_SERVER["SCRIPT_NAME"];
                if(substr($scriptName, -1)=='/') {