aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Files/Utils/PathHelper.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/Files/Utils/PathHelper.php')
-rw-r--r--lib/private/Files/Utils/PathHelper.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/private/Files/Utils/PathHelper.php b/lib/private/Files/Utils/PathHelper.php
index 07985e884ce..0fb7ba663cc 100644
--- a/lib/private/Files/Utils/PathHelper.php
+++ b/lib/private/Files/Utils/PathHelper.php
@@ -37,7 +37,7 @@ class PathHelper {
}
if ($path === $root) {
return '/';
- } elseif (strpos($path, $root . '/') !== 0) {
+ } elseif (!str_starts_with($path, $root . '/')) {
return null;
} else {
$path = substr($path, strlen($root));
@@ -60,7 +60,7 @@ class PathHelper {
$path = '/' . $path;
}
//remove duplicate slashes
- while (strpos($path, '//') !== false) {
+ while (str_contains($path, '//')) {
$path = str_replace('//', '/', $path);
}
//remove trailing slash