diff options
author | Morris Jobke <hey@morrisjobke.de> | 2017-04-26 18:21:13 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-26 18:21:13 -0300 |
commit | 4a9cb81486c38cb4158a3d988363c391ba023760 (patch) | |
tree | 88239f9b9255c7dd0d155d01afe6440a32e8dc94 /lib/private/legacy | |
parent | aad07945005cfb8b59287452453623e1b0d33dd1 (diff) | |
parent | 1c771c097a478ee461bfbc3447c84a4abea22c8c (diff) | |
download | nextcloud-server-4a9cb81486c38cb4158a3d988363c391ba023760.tar.gz nextcloud-server-4a9cb81486c38cb4158a3d988363c391ba023760.zip |
Merge pull request #4526 from nextcloud/downstream-27269
Don`t allow upload of files with extension .part
Diffstat (limited to 'lib/private/legacy')
-rw-r--r-- | lib/private/legacy/util.php | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/private/legacy/util.php b/lib/private/legacy/util.php index 9516a67af48..d49599cb8a1 100644 --- a/lib/private/legacy/util.php +++ b/lib/private/legacy/util.php @@ -1388,6 +1388,12 @@ class OC_Util { if (\OC\Files\Filesystem::isIgnoredDir($trimmed)) { return false; } + + // detect part files + if (preg_match('/' . \OCP\Files\FileInfo::BLACKLIST_FILES_REGEX . '/', $trimmed) !== 0) { + return false; + } + foreach (str_split($trimmed) as $char) { if (strpos(\OCP\Constants::FILENAME_INVALID_CHARS, $char) !== false) { return false; |