diff options
author | Lukas Reschke <lukas@owncloud.com> | 2015-02-13 12:49:34 +0100 |
---|---|---|
committer | Lukas Reschke <lukas@owncloud.com> | 2015-06-01 17:05:08 +0200 |
commit | 7b5493ea21925391e0cb6480faabb1c465b3437e (patch) | |
tree | 5b561ef5040410dacfbc75bf2df69bfd01698ece /lib | |
parent | 6867d45ffc931973e2720ad20e1020de84a77175 (diff) | |
download | nextcloud-server-7b5493ea21925391e0cb6480faabb1c465b3437e.tar.gz nextcloud-server-7b5493ea21925391e0cb6480faabb1c465b3437e.zip |
Ensure that passed argument is always a string
Some code paths called the `normalizePath` functionality with types other than a string which resulted in unexpected behaviour.
Thus the function is now manually casting the type to a string and I corrected the usage in list.php as well.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/files/filesystem.php | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/private/files/filesystem.php b/lib/private/files/filesystem.php index 707440632f2..9c125f56c62 100644 --- a/lib/private/files/filesystem.php +++ b/lib/private/files/filesystem.php @@ -723,9 +723,18 @@ class Filesystem { * Fix common problems with a file path * @param string $path * @param bool $stripTrailingSlash + * @param bool $isAbsolutePath * @return string */ public static function normalizePath($path, $stripTrailingSlash = true, $isAbsolutePath = false) { + /** + * FIXME: This is a workaround for existing classes and files which call + * this function with another type than a valid string. This + * conversion should get removed as soon as all existing + * function calls have been fixed. + */ + $path = (string)$path; + $cacheKey = json_encode([$path, $stripTrailingSlash, $isAbsolutePath]); if(isset(self::$normalizedPathCache[$cacheKey])) { |