Skip to content

Commit

Permalink
#7496 Don`t allow upload of files with extension .part
Browse files Browse the repository at this point in the history
  • Loading branch information
IljaN authored and DeepDiver1975 committed Mar 21, 2017
1 parent 86a1b4b commit 4d28571
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/private/legacy/util.php
Expand Up @@ -1387,6 +1387,12 @@ public static function isValidFileName($file) {
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;
Expand Down

0 comments on commit 4d28571

Please sign in to comment.