Permalink
Browse files

OK, there were four places the check for $section->{contained} needed

to be done, not two.
  • Loading branch information...
1 parent a8c5416 commit 7bb2ef37d718777d82eebea738bb93df4806c940 @jamiemccarthy jamiemccarthy committed Jul 12, 2002
Showing with 5 additions and 2 deletions.
  1. +5 −2 plugins/Search/Search.pm
View
@@ -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});
}
@@ -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

0 comments on commit 7bb2ef3

Please sign in to comment.