@matheusbsbs / matheus-bagliano / commits / ccb4b53913
Fork 0

gitweb: Fix snapshots requested via PATH_INFO

Fix the detection of the requested snapshot format, which failed for PATH_INFO URLs since the references to the hashes which describe the supported snapshot formats weren't dereferenced appropriately. Signed-off-by: Holger Weiß <holger@zedat.fu-berlin.de> Acked-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Holger Weiß committed Mar 31, 2009 at 18:16 UTC ccb4b5391382f4cdb5e5be49036e82e7d837b7af
1 file changed +2 -2
gitweb/gitweb.perl
+2 -2
@@ -688,10 +688,10 @@ sub evaluate_path_info {
688 # extensions. Allowed extensions are both the defined suffix
689 # (which includes the initial dot already) and the snapshot
690 # format key itself, with a prepended dot
691 - while (my ($fmt, %opt) = each %known_snapshot_formats) {
691 + while (my ($fmt, $opt) = each %known_snapshot_formats) {
692 my $hash = $refname;
693 my $sfx;
694 - $hash =~ s/(\Q$opt{'suffix'}\E|\Q.$fmt\E)$//;
694 + $hash =~ s/(\Q$opt->{'suffix'}\E|\Q.$fmt\E)$//;
695 next unless $sfx = $1;
696 # a valid suffix was found, so set the snapshot format
697 # and reset the hash parameter