summaryrefslogtreecommitdiffstats
path: root/lib/private/legacy/util.php
diff options
context:
space:
mode:
authorIlja Neumann <ineumann@owncloud.com>2017-02-27 18:30:10 +0100
committerJoas Schilling <coding@schilljs.com>2017-04-26 16:09:08 +0200
commit327094d5574ed9cf330edcf33529ef7745b7b5f0 (patch)
tree0e52a5493f075886697eb7e5a0b2cee29521e613 /lib/private/legacy/util.php
parent5b5c3a1773dab4960d41aafc4150859a308311b7 (diff)
downloadnextcloud-server-327094d5574ed9cf330edcf33529ef7745b7b5f0.tar.gz
nextcloud-server-327094d5574ed9cf330edcf33529ef7745b7b5f0.zip
#7496 Don`t allow upload of files with extension .part
Diffstat (limited to 'lib/private/legacy/util.php')
-rw-r--r--lib/private/legacy/util.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/private/legacy/util.php b/lib/private/legacy/util.php
index 9516a67af48..d2012835980 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;
}
+
+ $path_parts = pathinfo($trimmed);
+ if ($path_parts['extension'] === 'part') {
+ return false;
+ }
+
foreach (str_split($trimmed) as $char) {
if (strpos(\OCP\Constants::FILENAME_INVALID_CHARS, $char) !== false) {
return false;