Fix detection of non extention types
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
parent
8473a09499
commit
4356c91ffd
|
@ -203,9 +203,12 @@ class Detection implements IMimeTypeDetector {
|
||||||
$fileName = preg_replace('!((\.v\d+)|((\.ocTransferId\d+)?\.part))$!', '', $fileName);
|
$fileName = preg_replace('!((\.v\d+)|((\.ocTransferId\d+)?\.part))$!', '', $fileName);
|
||||||
|
|
||||||
//try to guess the type by the file extension
|
//try to guess the type by the file extension
|
||||||
$extension = strtolower(strrchr($fileName, '.'));
|
$extension = strrchr($fileName, '.');
|
||||||
$extension = substr($extension, 1); //remove leading .
|
if ($extension !== false) {
|
||||||
return $this->mimetypes[$extension][0] ?? 'application/octet-stream';
|
$extension = strtolower($extension);
|
||||||
|
$extension = substr($extension, 1); //remove leading .
|
||||||
|
return $this->mimetypes[$extension][0] ?? 'application/octet-stream';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 'application/octet-stream';
|
return 'application/octet-stream';
|
||||||
|
|
Loading…
Reference in New Issue