diff options
author | Morris Jobke <hey@morrisjobke.de> | 2018-01-25 22:26:47 +0100 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2018-01-26 13:38:34 +0100 |
commit | 9ff51aafc518460e6c45996f09e9fe74e5f8d2e8 (patch) | |
tree | 7aa302bf04530f0add196f6bcd6e8636333e6be0 /lib/private/Files/Filesystem.php | |
parent | b9bbb894f8b01e000bb5e3a8a82db7bebad3ea00 (diff) | |
download | nextcloud-server-9ff51aafc518460e6c45996f09e9fe74e5f8d2e8.tar.gz nextcloud-server-9ff51aafc518460e6c45996f09e9fe74e5f8d2e8.zip |
Use index based string access for substr with length of 1
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'lib/private/Files/Filesystem.php')
-rw-r--r-- | lib/private/Files/Filesystem.php | 4 |
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 '/.' |