Skip to content

Commit 3be8e72

Browse files
jnarebJunio C Hamano
authored andcommitted
gitweb: Quote hash keys, and do not use barewords keys
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>
1 parent a23f0a7 commit 3be8e72

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

gitweb/gitweb.perl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
binmode STDOUT, ':utf8';
2020

2121
BEGIN {
22-
CGI->compile() if $ENV{MOD_PERL};
22+
CGI->compile() if $ENV{'MOD_PERL'};
2323
}
2424

2525
our $cgi = new CGI;
@@ -1870,16 +1870,16 @@ sub git_print_page_nav {
18701870
my %arg = map { $_ => {action=>$_} } @navs;
18711871
if (defined $head) {
18721872
for (qw(commit commitdiff)) {
1873-
$arg{$_}{hash} = $head;
1873+
$arg{$_}{'hash'} = $head;
18741874
}
18751875
if ($current =~ m/^(tree | log | shortlog | commit | commitdiff | search)$/x) {
18761876
for (qw(shortlog log)) {
1877-
$arg{$_}{hash} = $head;
1877+
$arg{$_}{'hash'} = $head;
18781878
}
18791879
}
18801880
}
1881-
$arg{tree}{hash} = $treehead if defined $treehead;
1882-
$arg{tree}{hash_base} = $treebase if defined $treebase;
1881+
$arg{'tree'}{'hash'} = $treehead if defined $treehead;
1882+
$arg{'tree'}{'hash_base'} = $treebase if defined $treebase;
18831883

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

1930-
$args{action} = $action;
1931-
$args{hash} = $hash if $hash;
1932-
$args{hash_base} = $hash_base if $hash_base;
1930+
$args{'action'} = $action;
1931+
$args{'hash'} = $hash if $hash;
1932+
$args{'hash_base'} = $hash_base if $hash_base;
19331933

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

0 commit comments

Comments
 (0)