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.
$l = OC_L10N::get('files');
// Load the files
-$dir = isset($_GET['dir']) ? $_GET['dir'] : '';
+$dir = isset($_GET['dir']) ? (string)$_GET['dir'] : '';
$dir = \OC\Files\Filesystem::normalizePath($dir);
try {
* 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;
+
if ($path == '') {
return '/';
}