#7496 Don`t allow upload of files with extension .part

This commit is contained in:
Ilja Neumann 2017-02-27 18:30:10 +01:00 committed by Joas Schilling
parent 5b5c3a1773
commit 327094d557
No known key found for this signature in database
GPG Key ID: E166FD8976B3BAC8
1 changed files with 6 additions and 0 deletions

View File

@ -1388,6 +1388,12 @@ class OC_Util {
if (\OC\Files\Filesystem::isIgnoredDir($trimmed)) { if (\OC\Files\Filesystem::isIgnoredDir($trimmed)) {
return false; return false;
} }
$path_parts = pathinfo($trimmed);
if ($path_parts['extension'] === 'part') {
return false;
}
foreach (str_split($trimmed) as $char) { foreach (str_split($trimmed) as $char) {
if (strpos(\OCP\Constants::FILENAME_INVALID_CHARS, $char) !== false) { if (strpos(\OCP\Constants::FILENAME_INVALID_CHARS, $char) !== false) {
return false; return false;