Fix detection of non extention types
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
parent
877e1bb55b
commit
c743af30d6
|
@ -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';
|
||||
|
|
Loading…
Reference in New Issue