@matheusbsbs / matheus-bagliano / commits / 8059319acc
Fork 0

gitweb: Fix mimetype_guess_file for files with multiple extensions

Fix getting correct mimetype for "blob_plain" view for files which have multiple extensions, e.g. foo.1.html; now only the last extension is used to find mimetype. Noticed by Martin Waitz. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>

Jakub Narebski committed Sep 19, 2006 at 13:57 UTC 8059319acc3638c8398d1bd34f647a2b28f48d5c
1 file changed +1 -1
gitweb/gitweb.perl
+1 -1
@@ -1197,7 +1197,7 @@ sub mimetype_guess_file {
1197 }
1198 close(MIME);
1199
1200 - $filename =~ /\.(.*?)$/;
1200 + $filename =~ /\.([^.]*)$/;
1201 return $mimemap{$1};
1202 }
1203