Unbreaking ownCloud with php-7.0.6

Fix not needed with OwnCloud 9.0.2!

Not sure where to start. Good bug reports are usually showing a way to reproduce the bug – so here we go:

First, have ownCloud 9.0.1 running with a Redis Cache as a backend. Nothing funky so far besides the database not living on the same box. After a quick update of PHP 7.0.5 to 7.0.6 and a restart of the webserver, things were broken. I couldn’t log into ownCloud anymore.

My first suspect was the self compiled/patched/made phpredis extension, so I excluded those from my config and still got a broken login screen. Time to debug, since a downgrade provided cure.

After a while and some code reading I came to the conclusion that the function __isset() was broken somehow.

 /**
* @param string $name
* @return bool
*/
public function __isset($name) {
return isset($this->items['parameters'][$name]);
}

My clue was found in the Changelog of PHP, so I started to look at if there’s a workaround for isset().

I ended up with some code to fix this issue in a more or less crude way:

lib/private/appframework/http/request.php

/**
         * @param string $name
         * @return bool
         */
        public function __isset($name) {
                if (in_array($name, $this->allowedKeys, true)) {
                        return true;
                }
                return isset($this->items['parameters'][$name]);
        }

Hope this helps.

Author:

Leave a Reply

Your email address will not be published. Required fields are marked *