From 6c501f90bb3bf61edbe507b9864146d1642a328b Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Sun, 26 Feb 2012 04:09:48 +0100 Subject: [PATCH] hopefully a fix for webroot detection --- lib/base.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/base.php b/lib/base.php index 342bdc6768e..404f3dd7f91 100644 --- a/lib/base.php +++ b/lib/base.php @@ -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));