Fix strpos if needle is not found

Found while testing strict_typing for PHP 7+. If `$script` does not contain a `/` then it should extract a string of the length 0.

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
This commit is contained in:
Morris Jobke 2018-01-12 15:01:45 +01:00
parent 33a6e265b2
commit e3c0fd6882
No known key found for this signature in database
GPG Key ID: FE03C3A163FEDE68
1 changed files with 1 additions and 1 deletions

View File

@ -671,7 +671,7 @@ class OC_App {
public static function getCurrentApp() {
$request = \OC::$server->getRequest();
$script = substr($request->getScriptName(), strlen(OC::$WEBROOT) + 1);
$topFolder = substr($script, 0, strpos($script, '/'));
$topFolder = substr($script, 0, strpos($script, '/') ?: 0);
if (empty($topFolder)) {
$path_info = $request->getPathInfo();
if ($path_info) {