hopefully a fix for webroot detection

This commit is contained in:
Robin Appelman 2012-02-26 04:09:48 +01:00
parent 0af31a5328
commit 6c501f90bb
1 changed files with 7 additions and 0 deletions

View File

@ -143,6 +143,13 @@ class OC{
$scriptName=$_SERVER["SCRIPT_NAME"];
if(substr($scriptName,-1)=='/'){
$scriptName.='index.php';
//make sure suburi follows the same rules as scriptName
if(substr(OC::$SUBURI,-9)!='index.php'){
if(substr(OC::$SUBURI,-1)!='/'){
OC::$SUBURI=OC::$SUBURI.'/';
}
OC::$SUBURI=OC::$SUBURI.'index.php';
}
}
OC::$WEBROOT=substr($scriptName,0,strlen($scriptName)-strlen(OC::$SUBURI));