Skip to content

Commit

Permalink
Case-insensitive test for guessing document type by file extension. F…
Browse files Browse the repository at this point in the history
…ixes #54
  • Loading branch information
drn05r authored and EPrints Services committed May 11, 2020
1 parent c841dda commit 7828cf3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/cfg.d/media_info.pl
Expand Up @@ -12,19 +12,19 @@
}
}

if( $filename =~ /\.(pdf|doc|docx|odt)$/ && $valid{text} )
if( $filename =~ /\.(pdf|doc|docx|odt)$/i && $valid{text} )
{
return "text";
}
elsif( $filename =~ /\.(ppt|pptx|odp)$/ && $valid{slideshow} )
elsif( $filename =~ /\.(ppt|pptx|odp)$/i && $valid{slideshow} )
{
return "slideshow";
}
elsif( $filename =~ /\.(zip|tgz|gz)$/ && $valid{archive} )
elsif( $filename =~ /\.(zip|tgz|gz)$/i && $valid{archive} )
{
return "archive";
}
elsif( $filename =~ /\.(xls|xlsx|ods)$/ && $valid{spreadsheet} )
elsif( $filename =~ /\.(xls|xlsx|ods)$/i && $valid{spreadsheet} )
{
return "spreadsheet";
}
Expand Down

1 comment on commit 7828cf3

@Pfiffikus
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the most fast closed issue ever!?

Please sign in to comment.