From 9fcf185c7de856c90d3399663546798bd502c93b Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Sat, 17 Feb 2018 15:37:32 +0100 Subject: Always return a string in OC_App::getCurrentApp and no boolean Signed-off-by: Morris Jobke --- lib/private/legacy/app.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/private/legacy') diff --git a/lib/private/legacy/app.php b/lib/private/legacy/app.php index 61f639953ec..68869df5721 100644 --- a/lib/private/legacy/app.php +++ b/lib/private/legacy/app.php @@ -616,7 +616,7 @@ class OC_App { * * @return string */ - public static function getCurrentApp() { + public static function getCurrentApp(): string { $request = \OC::$server->getRequest(); $script = substr($request->getScriptName(), strlen(OC::$WEBROOT) + 1); $topFolder = substr($script, 0, strpos($script, '/') ?: 0); @@ -628,7 +628,7 @@ class OC_App { } if ($topFolder == 'apps') { $length = strlen($topFolder); - return substr($script, $length + 1, strpos($script, '/', $length + 1) - $length - 1); + return substr($script, $length + 1, strpos($script, '/', $length + 1) - $length - 1) ?: ''; } else { return $topFolder; } -- cgit v1.2.3