[Owncloud] Possible fix for endless redirects on IIS from OC v3.0 to v4.0

Thomas Tanghus thomas at tanghus.net
Fri May 25 10:16:20 UTC 2012


On Thursday 24 May 2012 16:26 Dr. Hirn wrote:
> Hi,
> 
> I'm not used to PHP but tried to get an easy fix for the problem, that
> unconfigured OwnCloud is endlessly redirecting when installed on IIS.
> Problem is in /lib/base.php on line 202 (in v4.0.0):
> 
> if (!OC_Config::getValue('installed', false) && OC::$SUBURI !=
> '/index.php') {
> 
> On an Microsoft OS, $SUBURI will never be /index.php. It will be
> \index.php. Backslash instead of slash.
> 
> I thought about another way to define $SUBURI and tried some possibilites.
> But somehow I think, the following is the easiest way to solve it.
> I changed
> OC::$SUBURI=substr(realpath($_SERVER["SCRIPT_FILENAME"]),strlen(OC::$SERVERR
> OOT)); to
> OC::$SUBURI=substr(realpath($_SERVER["SCRIPT_FILENAME"]),strlen(OC::$SERVERR
> OOT)+1); to eleminate the slash.
> 
> And then changed
> if (!OC_Config::getValue('installed', false) && OC::$SUBURI !=
> '/index.php') {
> to
> if (!OC_Config::getValue('installed', false) && OC::$SUBURI != 'index.php')
> {
> 
> What do you think of this?
> 
> Stefan

or:

if (!OC_Config::getValue('installed', false) && OC::$SUBURI != 
DIRECTORY_SEPARATOR.'index.php') {

-- 
Med venlig hilsen / Best Regards

Thomas Tanghus



More information about the Owncloud mailing list