]> Lady’s Gitweb - Gitweb/commitdiff
gitweb: fix 'ctags' feature check and others
authorJunio C Hamano <redacted>
Sat, 29 Nov 2008 20:53:41 +0000 (12:53 -0800)
committerLady <redacted>
Mon, 6 Apr 2026 04:50:38 +0000 (00:50 -0400)
gitweb_check_feature() function is to retrieve the configuration parameter
list and calling it in the scalar context does not give its first element
that tells if the feature is enabled.  This fixes all the existing callers
to call the function correctly in the list context.

Signed-off-by: Junio C Hamano <redacted>
gitweb.perl

index 13c9c28f5d4e0638cb6fdd61d187bdbba3fba3095662bca0eb8bb9efe23124f6..d1c345f8c5f463f84b9c43204a16d7d6b85e036ca60e148f6b1a02a32d242bca 100755 (executable)
@@ -3915,7 +3915,7 @@ sub fill_project_list_info {
        my ($projlist, $check_forks) = @_;
        my @projects;
 
-       my $show_ctags = gitweb_check_feature('ctags');
+       my ($show_ctags) = gitweb_check_feature('ctags');
  PROJECT:
        foreach my $pr (@$projlist) {
                my (@activity) = git_get_last_activity($pr->{'path'});
@@ -3989,7 +3989,7 @@ sub git_project_list_body {
                @projects = sort {$a->{$oi->{'key'}} <=> $b->{$oi->{'key'}}} @projects;
        }
 
-       my $show_ctags = gitweb_check_feature('ctags');
+       my ($show_ctags) = gitweb_check_feature('ctags');
        if ($show_ctags) {
                my %ctags;
                foreach my $p (@projects) {
@@ -4458,7 +4458,7 @@ sub git_summary {
        }
 
        # Tag cloud
-       my $show_ctags = (gitweb_check_feature('ctags'))[0];
+       my ($show_ctags) = gitweb_check_feature('ctags');
        if ($show_ctags) {
                my $ctags = git_get_project_ctags($project);
                my $cloud = git_populate_project_tagcloud($ctags);
@@ -4560,7 +4560,7 @@ sub git_blame {
        my $fd;
        my $ftype;
 
-       gitweb_check_feature('blame')
+       gitweb_check_feature('blame')[0]
            or die_error(403, "Blame view not allowed");
 
        die_error(400, "No file name given") unless $file_name;
@@ -5611,7 +5611,7 @@ sub git_history {
 }
 
 sub git_search {
-       gitweb_check_feature('search') or die_error(403, "Search is disabled");
+       gitweb_check_feature('search')[0] or die_error(403, "Search is disabled");
        if (!defined $searchtext) {
                die_error(400, "Text field is empty");
        }
@@ -5630,11 +5630,11 @@ sub git_search {
        if ($searchtype eq 'pickaxe') {
                # pickaxe may take all resources of your box and run for several minutes
                # with every query - so decide by yourself how public you make this feature
-               gitweb_check_feature('pickaxe')
+               gitweb_check_feature('pickaxe')[0]
                    or die_error(403, "Pickaxe is disabled");
        }
        if ($searchtype eq 'grep') {
-               gitweb_check_feature('grep')
+               gitweb_check_feature('grep')[0]
                    or die_error(403, "Grep is disabled");
        }
 
This page took 0.064756 seconds and 4 git commands to generate.