Skip to content

Commit

Permalink
Merge pull request #2151 from kareila/1891-commentsearch
Browse files Browse the repository at this point in the history
[#1891] do server-side permission check for comment search
  • Loading branch information
zorkian committed Apr 30, 2017
2 parents 4b6744e + 0141bc4 commit 30dc6af
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cgi-bin/DW/Controller/Search/Journal.pm
Expand Up @@ -100,7 +100,11 @@ sub search_handler {
my $sby = $post_args->{sort_by} || 'new';
$sby = 'new' unless $sby =~ /^(?:new|old|rel)$/;

# see if the user wants to include comments, then verify that they are
# allowed to do so; if not, just ignore that they checked the checkbox
my $wc = $post_args->{with_comments} ? 1 : 0;
my $wc_u = $su || $remote;
$wc &&= $wc_u->is_paid; # comment search is a paid account feature

$rv->{sort_by} = $sby;
$rv->{wc} = $wc;
Expand Down

0 comments on commit 30dc6af

Please sign in to comment.