Changeset 339
- Timestamp:
- 01/24/11 11:01:39 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
server/trunk/web/lib/Sophie/Scan/RpmParser/Sources.pm
r336 r339 10 10 use Encode::Guess; 11 11 use Encode; 12 use MIME::Types;12 use File::MMagic; 13 13 14 14 sub run { … … 39 39 } 40 40 41 if (my $plaintext = MIME::Types->new->mimeTypeOf($fname)) {42 $plaintext->isBinary and return 1;43 }44 45 41 my $rawcontent = $file->get_content; 42 43 my $mm = new File::MMagic; 44 $mm->checktype_contents($rawcontent) =~ /^application\// and return 1; 45 46 46 my $content; 47 47 foreach my $line (split("\n", $rawcontent)) {
Note: See TracChangeset
for help on using the changeset viewer.