diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2019-12-12 09:58:22 +0100 |
---|---|---|
committer | Backportbot <backportbot-noreply@rullzer.com> | 2019-12-12 22:06:09 +0000 |
commit | 290b4f2ece5f2744d698716518a07140dfe23e47 (patch) | |
tree | 0399d2e74ab7c8e6abc7998de5af7ad794fd2c36 | |
parent | d5d8bb05770e32ca9e9a1991fae2d848922a9a18 (diff) | |
download | nextcloud-server-290b4f2ece5f2744d698716518a07140dfe23e47.tar.gz nextcloud-server-290b4f2ece5f2744d698716518a07140dfe23e47.zip |
Fix detection of non extention types
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
-rw-r--r-- | lib/private/Files/Type/Detection.php | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/private/Files/Type/Detection.php b/lib/private/Files/Type/Detection.php index 2801bfadd17..ebd28e7cd24 100644 --- a/lib/private/Files/Type/Detection.php +++ b/lib/private/Files/Type/Detection.php @@ -181,8 +181,11 @@ class Detection implements IMimeTypeDetector { $fileName = preg_replace('!((\.v\d+)|((\.ocTransferId\d+)?\.part))$!', '', $fileName); //try to guess the type by the file extension - $extension = strtolower(strrchr($fileName, '.')); - $extension = substr($extension, 1); //remove leading . + $extension = strrchr($fileName, '.'); + if ($extension !== false) { + $extension = strtolower($extension); + $extension = substr($extension, 1); //remove leading . + } return (isset($this->mimetypes[$extension]) && isset($this->mimetypes[$extension][0])) ? $this->mimetypes[$extension][0] : 'application/octet-stream'; |