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:07:03 +0200 |
commit | 5154cc3e2c0e9d7f0a0e44d1609f3c3b83ccc402 (patch) | |
tree | 8b80767a37346b361f060283c0163a28ff399245 /lib | |
parent | bf0f1a50926a75a26a42a3da4d62e84a489ee77a (diff) | |
download | nextcloud-server-5154cc3e2c0e9d7f0a0e44d1609f3c3b83ccc402.tar.gz nextcloud-server-5154cc3e2c0e9d7f0a0e44d1609f3c3b83ccc402.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 | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/private/files/filesystem.php b/lib/private/files/filesystem.php index 7b031cb88c7..5e6bdfaa4ef 100644 --- a/lib/private/files/filesystem.php +++ b/lib/private/files/filesystem.php @@ -616,6 +616,14 @@ class Filesystem { * @return string */ public static function normalizePath($path, $stripTrailingSlash = true) { + /** + * 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; + if ($path == '') { return '/'; } |