Merge pull request #7816 from nextcloud/fix-strpos-for-current-app

Fix strpos if needle is not found
This commit is contained in:
Roeland Jago Douma 2018-01-12 16:55:27 +01:00 committed by GitHub
commit 15bbf08774
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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) {