summaryrefslogtreecommitdiffstats
path: root/lib/private/Files/Filesystem.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/Files/Filesystem.php')
-rw-r--r--lib/private/Files/Filesystem.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/private/Files/Filesystem.php b/lib/private/Files/Filesystem.php
index caf23afba11..95703eab925 100644
--- a/lib/private/Files/Filesystem.php
+++ b/lib/private/Files/Filesystem.php
@@ -839,8 +839,8 @@ class Filesystem {
$path = preg_replace('#/{2,}#', '/', $path);
//remove trailing slash
- if ($stripTrailingSlash and strlen($path) > 1 and substr($path, -1, 1) === '/') {
- $path = substr($path, 0, -1);
+ if ($stripTrailingSlash and strlen($path) > 1) {
+ $path = rtrim($path, '/');
}
// remove trailing '/.'