X-Git-Url: https://git.ladys.computer/Gitweb/blobdiff_plain/bf9aa082309cd2e6e47e90f7da06034ab5e2a922ecfdad1c29d2e52c75467185..92c325a48bdcbb34278537bf0d74f77bf9ca571959af68294e6e620d92561803:/gitweb.perl diff --git a/gitweb.perl b/gitweb.perl index 09f1135..1bbe41c 100755 --- a/gitweb.perl +++ b/gitweb.perl @@ -689,10 +689,10 @@ sub evaluate_path_info { # extensions. Allowed extensions are both the defined suffix # (which includes the initial dot already) and the snapshot # format key itself, with a prepended dot - while (my ($fmt, %opt) = each %known_snapshot_formats) { + while (my ($fmt, $opt) = each %known_snapshot_formats) { my $hash = $refname; my $sfx; - $hash =~ s/(\Q$opt{'suffix'}\E|\Q.$fmt\E)$//; + $hash =~ s/(\Q$opt->{'suffix'}\E|\Q.$fmt\E)$//; next unless $sfx = $1; # a valid suffix was found, so set the snapshot format # and reset the hash parameter @@ -1385,13 +1385,11 @@ sub format_log_line_html { my $line = shift; $line = esc_html($line, -nbsp=>1); - if ($line =~ m/\b([0-9a-fA-F]{8,40})\b/) { - my $hash_text = $1; - my $link = - $cgi->a({-href => href(action=>"object", hash=>$hash_text), - -class => "text"}, $hash_text); - $line =~ s/$hash_text/$link/; - } + $line =~ s{\b([0-9a-fA-F]{8,40})\b}{ + $cgi->a({-href => href(action=>"object", hash=>$1), + -class => "text"}, $1); + }eg; + return $line; }