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:
parent
33a6e265b2
commit
e3c0fd6882
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue