Skip to content

Commit

Permalink
Update MimeType.zep
Browse files Browse the repository at this point in the history
Prevent fatal errors.
  • Loading branch information
zikezhang authored Sep 16, 2024
1 parent 83677f1 commit d81bbaa
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions phalcon/Filter/Validation/Validator/File/MimeType.zep
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,13 @@ class MimeType extends AbstractFile

if function_exists("finfo_open") {
let tmp = finfo_open(FILEINFO_MIME_TYPE),
mime = finfo_file(tmp, value["tmp_name"]);
if (tmp) {
mime = finfo_file(tmp, value["tmp_name"]);
finfo_close(tmp);
}
};

finfo_close(tmp);
} else {
if (!mime) {
let mime = value["type"];
}

Expand Down

0 comments on commit d81bbaa

Please sign in to comment.