Browse Source

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>
maint
Jakub Narebski 19 years ago committed by Junio C Hamano
parent
commit
8059319acc
  1. 2
      gitweb/gitweb.perl

2
gitweb/gitweb.perl

@ -1197,7 +1197,7 @@ sub mimetype_guess_file { @@ -1197,7 +1197,7 @@ sub mimetype_guess_file {
}
close(MIME);

$filename =~ /\.(.*?)$/;
$filename =~ /\.([^.]*)$/;
return $mimemap{$1};
}


Loading…
Cancel
Save