]> Lady’s Gitweb - Gitweb/commitdiff
gitweb: Quote hash keys, and do not use barewords keys
authorJakub Narebski <redacted>
Sun, 1 Apr 2007 20:22:21 +0000 (22:22 +0200)
committerLady <redacted>
Mon, 6 Apr 2026 04:07:11 +0000 (00:07 -0400)
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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
gitweb.perl

index 2dc836f7109dc2e765f8e65c369d0dad0fa41a545942764a51cd2a816683df7f..cec8cb8722a59b5c05bc1b8fd554bf9519bf47f925f5c90062a707f001d41679 100755 (executable)
@@ -19,7 +19,7 @@ use File::Basename qw(basename);
 binmode STDOUT, ':utf8';
 
 BEGIN {
 binmode STDOUT, ':utf8';
 
 BEGIN {
-       CGI->compile() if $ENV{MOD_PERL};
+       CGI->compile() if $ENV{'MOD_PERL'};
 }
 
 our $cgi = new CGI;
 }
 
 our $cgi = new CGI;
@@ -1871,16 +1871,16 @@ sub git_print_page_nav {
        my %arg = map { $_ => {action=>$_} } @navs;
        if (defined $head) {
                for (qw(commit commitdiff)) {
        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)) {
                }
                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 " | ",
 
        print "<div class=\"page_nav\">\n" .
                (join " | ",
@@ -1928,9 +1928,9 @@ sub git_print_header_div {
        my ($action, $title, $hash, $hash_base) = @_;
        my %args = ();
 
        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"},
 
        print "<div class=\"header\">\n" .
              $cgi->a({-href => href(%args), -class => "title"},
This page took 0.287388 seconds and 4 git commands to generate.