Skip to content

Commit 8d2dbba

Browse files
committed
gitweb: fix 'ctags' feature check and others
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 <gitster@pobox.com>
1 parent d5cbdba commit 8d2dbba

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

gitweb/gitweb.perl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3914,7 +3914,7 @@ sub fill_project_list_info {
39143914
my ($projlist, $check_forks) = @_;
39153915
my @projects;
39163916

3917-
my $show_ctags = gitweb_check_feature('ctags');
3917+
my ($show_ctags) = gitweb_check_feature('ctags');
39183918
PROJECT:
39193919
foreach my $pr (@$projlist) {
39203920
my (@activity) = git_get_last_activity($pr->{'path'});
@@ -3988,7 +3988,7 @@ sub git_project_list_body {
39883988
@projects = sort {$a->{$oi->{'key'}} <=> $b->{$oi->{'key'}}} @projects;
39893989
}
39903990

3991-
my $show_ctags = gitweb_check_feature('ctags');
3991+
my ($show_ctags) = gitweb_check_feature('ctags');
39923992
if ($show_ctags) {
39933993
my %ctags;
39943994
foreach my $p (@projects) {
@@ -4457,7 +4457,7 @@ sub git_summary {
44574457
}
44584458

44594459
# Tag cloud
4460-
my $show_ctags = (gitweb_check_feature('ctags'))[0];
4460+
my ($show_ctags) = gitweb_check_feature('ctags');
44614461
if ($show_ctags) {
44624462
my $ctags = git_get_project_ctags($project);
44634463
my $cloud = git_populate_project_tagcloud($ctags);
@@ -4559,7 +4559,7 @@ sub git_blame {
45594559
my $fd;
45604560
my $ftype;
45614561

4562-
gitweb_check_feature('blame')
4562+
gitweb_check_feature('blame')[0]
45634563
or die_error(403, "Blame view not allowed");
45644564

45654565
die_error(400, "No file name given") unless $file_name;
@@ -5610,7 +5610,7 @@ sub git_history {
56105610
}
56115611

56125612
sub git_search {
5613-
gitweb_check_feature('search') or die_error(403, "Search is disabled");
5613+
gitweb_check_feature('search')[0] or die_error(403, "Search is disabled");
56145614
if (!defined $searchtext) {
56155615
die_error(400, "Text field is empty");
56165616
}
@@ -5629,11 +5629,11 @@ sub git_search {
56295629
if ($searchtype eq 'pickaxe') {
56305630
# pickaxe may take all resources of your box and run for several minutes
56315631
# with every query - so decide by yourself how public you make this feature
5632-
gitweb_check_feature('pickaxe')
5632+
gitweb_check_feature('pickaxe')[0]
56335633
or die_error(403, "Pickaxe is disabled");
56345634
}
56355635
if ($searchtype eq 'grep') {
5636-
gitweb_check_feature('grep')
5636+
gitweb_check_feature('grep')[0]
56375637
or die_error(403, "Grep is disabled");
56385638
}
56395639

0 commit comments

Comments
 (0)