From e7cc7653b885c49b1b3f0a78f91ea05a53e102d8 Mon Sep 17 00:00:00 2001 From: Faraz Samapoor Date: Mon, 15 May 2023 15:17:19 +0330 Subject: Refactors "strpos" calls in lib/private to improve code readability. Signed-off-by: Faraz Samapoor --- lib/private/Files/View.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/private/Files/View.php') diff --git a/lib/private/Files/View.php b/lib/private/Files/View.php index a73b60989fd..d256003537d 100644 --- a/lib/private/Files/View.php +++ b/lib/private/Files/View.php @@ -168,7 +168,7 @@ class View { // missing slashes can cause wrong matches! $root = rtrim($this->fakeRoot, '/') . '/'; - if (strpos($path, $root) !== 0) { + if (!str_starts_with($path, $root)) { return null; } else { $path = substr($path, strlen($this->fakeRoot)); @@ -2079,7 +2079,7 @@ class View { return ($pathSegments[2] === 'files') && (count($pathSegments) > 3); } - return strpos($path, '/appdata_') !== 0; + return !str_starts_with($path, '/appdata_'); } /** -- cgit v1.2.3