summaryrefslogtreecommitdiffstats
path: root/lib/private/legacy
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2018-02-17 15:37:32 +0100
committerMorris Jobke <hey@morrisjobke.de>2018-02-17 16:05:23 +0100
commit9fcf185c7de856c90d3399663546798bd502c93b (patch)
treea80aef4d0f2687f83f2618984890fddffd2c3dbf /lib/private/legacy
parente4077672e15809d04df4fd2af3df998dfed04292 (diff)
downloadnextcloud-server-9fcf185c7de856c90d3399663546798bd502c93b.tar.gz
nextcloud-server-9fcf185c7de856c90d3399663546798bd502c93b.zip
Always return a string in OC_App::getCurrentApp and no boolean
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'lib/private/legacy')
-rw-r--r--lib/private/legacy/app.php4
1 files changed, 2 insertions, 2 deletions
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;
}