summaryrefslogtreecommitdiffstats
path: root/lib/private/legacy/app.php
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2018-01-12 15:01:45 +0100
committerMorris Jobke <hey@morrisjobke.de>2018-01-12 15:01:45 +0100
commite3c0fd68827fc3dc6082654ed9919b820dfbd74e (patch)
tree9e211961f512d9e7eeb86a2bdb16d6980105cad0 /lib/private/legacy/app.php
parent33a6e265b24f7da3092fb55d50ef14e8ada6858d (diff)
downloadnextcloud-server-e3c0fd68827fc3dc6082654ed9919b820dfbd74e.tar.gz
nextcloud-server-e3c0fd68827fc3dc6082654ed9919b820dfbd74e.zip
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>
Diffstat (limited to 'lib/private/legacy/app.php')
-rw-r--r--lib/private/legacy/app.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/private/legacy/app.php b/lib/private/legacy/app.php
index 1b9fc28873e..8114895416b 100644
--- a/lib/private/legacy/app.php
+++ b/lib/private/legacy/app.php
@@ -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) {