Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Testing mime type with FINFO too.

  • Loading branch information...
commit 1ebd7fbeee6623e24e732b0f3160f16ad1ca58ad 1 parent 6075818
@jrbasso jrbasso authored
Showing with 8 additions and 1 deletion.
  1. +8 −1 models/behaviors/meio_upload.php
View
9 models/behaviors/meio_upload.php
@@ -548,7 +548,14 @@ function uploadCheckInvalidMime(&$model, $data) {
if ($info !== false && in_array($info['mime'], $options['allowedMime'])) {
continue;
}
- if (function_exists('mime_content_type')) {
+ if (function_exists('finfo_open')) {
+ $finfo = finfo_open(FILEINFO_MIME_TYPE);
+ $info = finfo_file($finfo, $field['tmp_name']);
+ if ($info !== false && in_array($info, $options['allowedMime'])) {
+ continue;
+ }
+ }
+ if (function_exists('mime_content_type')) { // @deprecated
$info = mime_content_type($field['tmp_name']);
if ($info !== false && in_array($info, $options['allowedMime'])) {
continue;
Please sign in to comment.
Something went wrong with that request. Please try again.