Skip to content

Commit

Permalink
Address warning with $fm_mt being undefined.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstos committed Feb 2, 2011
1 parent 3f332b1 commit 29e4601
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Changes
Expand Up @@ -13,6 +13,8 @@ Revision history for Perl extension CGI::Uploader.

- Now require Perl 5.8 as the minimum version.

- Address warning about $fm_mt being undefined.

2.17 Thu Apr 2 11:43:50 EDT 2009
[BUG FIXES]
- Small but fatal typo fix from 2.16 release cycle.
Expand Down
2 changes: 1 addition & 1 deletion lib/CGI/Uploader.pm
Expand Up @@ -936,7 +936,7 @@ sub extract_meta {
# If the uploaded mime_type was not provided calculate one from the file magic number
# if that does not exist, fall back on the file name
my $fm_mt = $mm->checktype_magic($tmp_filename);
$fm_mt = $mm->checktype_filename($tmp_filename) if (not length $fm_mt) ;
$fm_mt = $mm->checktype_filename($tmp_filename) if (not defined $fm_mt or not length $fm_mt) ;

my $mt = ($uploaded_mt || $fm_mt);
assert($mt,'found mime type');
Expand Down

0 comments on commit 29e4601

Please sign in to comment.