Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

to be done, not two.
  • Loading branch information...
commit 7bb2ef37d718777d82eebea738bb93df4806c940 1 parent a8c5416
@jamiemccarthy jamiemccarthy authored
Showing with 5 additions and 2 deletions.
  1. +5 −2 plugins/Search/Search.pm
View
7 plugins/Search/Search.pm
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.