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

Dr. Hirn drhirn at gmail.com
Thu May 24 14:26:36 UTC 2012


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::$SERVERROOT));
to
OC::$SUBURI=substr(realpath($_SERVER["SCRIPT_FILENAME"]),strlen(OC::$SERVERROOT)+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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/owncloud/attachments/20120524/c4f1e121/attachment.html>


More information about the Owncloud mailing list