diff options
author | Lukas Reschke <lukas@owncloud.com> | 2015-02-06 15:22:25 +0100 |
---|---|---|
committer | Lukas Reschke <lukas@owncloud.com> | 2015-02-06 15:53:13 +0100 |
commit | 267341fbeba5d1ef110b50e7cead9b0d26068fc1 (patch) | |
tree | 38bbd1db32469d4b62eb392df3fb5fb71ab6d2f3 /lib/private | |
parent | 0bccd06bc803c56fbdbd9eef84232de83fa106ba (diff) | |
download | nextcloud-server-267341fbeba5d1ef110b50e7cead9b0d26068fc1.tar.gz nextcloud-server-267341fbeba5d1ef110b50e7cead9b0d26068fc1.zip |
Normalize before processing
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/files/filesystem.php | 10 | ||||
-rw-r--r-- | lib/private/files/mapper.php | 2 |
2 files changed, 7 insertions, 5 deletions
diff --git a/lib/private/files/filesystem.php b/lib/private/files/filesystem.php index 0aa5f16ec6d..7b031cb88c7 100644 --- a/lib/private/files/filesystem.php +++ b/lib/private/files/filesystem.php @@ -452,9 +452,10 @@ class Filesystem { * @return bool */ static public function isFileBlacklisted($filename) { + $filename = self::normalizePath($filename); $blacklist = \OC_Config::getValue('blacklisted_files', array('.htaccess')); $filename = strtolower(basename($filename)); - return (in_array($filename, $blacklist)); + return in_array($filename, $blacklist); } /** @@ -618,6 +619,10 @@ class Filesystem { if ($path == '') { return '/'; } + + //normalize unicode if possible + $path = \OC_Util::normalizeUnicode($path); + //no windows style slashes $path = str_replace('\\', '/', $path); @@ -646,9 +651,6 @@ class Filesystem { $path = substr($path, 0, -2); } - //normalize unicode if possible - $path = \OC_Util::normalizeUnicode($path); - return $path; } diff --git a/lib/private/files/mapper.php b/lib/private/files/mapper.php index 47abd4e52fe..b2633947b94 100644 --- a/lib/private/files/mapper.php +++ b/lib/private/files/mapper.php @@ -230,7 +230,7 @@ class Mapper // trim ending dots (for security reasons and win compatibility) $text = preg_replace('~\.+$~', '', $text); - if (empty($text)) { + if (empty($text) || \OC\Files\Filesystem::isFileBlacklisted($text)) { return uniqid(); } |