Skip to content

Commit

Permalink
gitweb: Quote hash keys, and do not use barewords keys
Browse files Browse the repository at this point in the history
Ensure that in all references to an element of a hash, the
key is singlequoted, instead of using bareword: use $hash{'key'}
instead of $hash{key}

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Jakub Narebski authored and Junio C Hamano committed Apr 4, 2007
1 parent a23f0a7 commit 3be8e72
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions gitweb/gitweb.perl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
binmode STDOUT, ':utf8';

BEGIN {
CGI->compile() if $ENV{MOD_PERL};
CGI->compile() if $ENV{'MOD_PERL'};
}

our $cgi = new CGI;
Expand Down Expand Up @@ -1870,16 +1870,16 @@ sub git_print_page_nav {
my %arg = map { $_ => {action=>$_} } @navs;
if (defined $head) {
for (qw(commit commitdiff)) {
$arg{$_}{hash} = $head;
$arg{$_}{'hash'} = $head;
}
if ($current =~ m/^(tree | log | shortlog | commit | commitdiff | search)$/x) {
for (qw(shortlog log)) {
$arg{$_}{hash} = $head;
$arg{$_}{'hash'} = $head;
}
}
}
$arg{tree}{hash} = $treehead if defined $treehead;
$arg{tree}{hash_base} = $treebase if defined $treebase;
$arg{'tree'}{'hash'} = $treehead if defined $treehead;
$arg{'tree'}{'hash_base'} = $treebase if defined $treebase;

print "<div class=\"page_nav\">\n" .
(join " | ",
Expand Down Expand Up @@ -1927,9 +1927,9 @@ sub git_print_header_div {
my ($action, $title, $hash, $hash_base) = @_;
my %args = ();

$args{action} = $action;
$args{hash} = $hash if $hash;
$args{hash_base} = $hash_base if $hash_base;
$args{'action'} = $action;
$args{'hash'} = $hash if $hash;
$args{'hash_base'} = $hash_base if $hash_base;

print "<div class=\"header\">\n" .
$cgi->a({-href => href(%args), -class => "title"},
Expand Down

0 comments on commit 3be8e72

Please sign in to comment.