return false;
}
- if (!empty($this->fileTypeFilters['isImage']) && ($uploadFile->getImageData() === null || !preg_match('~^image/(gif|jpe?g|png)$~i', $uploadFile->getMimeType()))) {
+ if (!empty($this->fileTypeFilters['isImage']) && $uploadFile->getImageData() === null) {
$uploadFile->setValidationErrorType('noImage');
return false;
}
* @return array|null
*/
public function getImageData() {
- if (strpos($this->getMimeType(), 'image/') == 0) {
- if (($imageData = @getimagesize($this->getLocation())) !== false) {
- return [
- 'width' => $imageData[0],
- 'height' => $imageData[1],
- 'mimeType' => $imageData['mime']
- ];
- }
+ if (($imageData = @getimagesize($this->getLocation())) !== false) {
+ return [
+ 'width' => $imageData[0],
+ 'height' => $imageData[1],
+ 'mimeType' => $imageData['mime']
+ ];
}
return null;