Skip to content

Commit

Permalink
OK, there were four places the check for $section->{contained} needed
Browse files Browse the repository at this point in the history
to be done, not two.
  • Loading branch information
jamiemccarthy committed Jul 12, 2002
1 parent a8c5416 commit 7bb2ef3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions plugins/Search/Search.pm
Expand Up @@ -120,7 +120,7 @@ sub findComments {
} else {
if ($section->{type} eq 'collected') {
$where .= " AND discussions.section IN ('" . join("','", @{$section->{contained}}) . "')"
if (@{$section->{contained}});
if $section->{contained} && @{$section->{contained}};
} else {
$where .= " AND discussions.section = " . $self->sqlQuote($section->{section});
}
Expand Down Expand Up @@ -272,7 +272,10 @@ sub findStory {
if ($form->{section}) {
if ($form->{section} ne $constants->{section}) {
if ($section->{type} eq 'collected') {
if ((scalar(@{$section->{contained}}) == 0) || (grep { $form->{section} eq $_ } @{$section->{contained}})) {
if (!$section->{contained}
|| scalar(@{$section->{contained}}) == 0
|| (grep { $form->{section} eq $_ } @{$section->{contained}})
) {
$where .= " AND stories.section = " . $self->sqlQuote($form->{section});
} else {
# Section doesn't belong to this contained section
Expand Down

0 comments on commit 7bb2ef3

Please sign in to comment.