Skip to content

Commit

Permalink
Issue #131 ensure $values is an array to prevent PHP error on implode…
Browse files Browse the repository at this point in the history
…() (#146)

Some plugins (such as Events) add taxonomy values that do not resolve in arrays as the simplesearch expects, so skip them.
  • Loading branch information
Vincent Purcell authored and rhukster committed Jul 20, 2018
1 parent a03a47d commit 8a42f06
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion simplesearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ private function notFound($query, $page, $taxonomies)
$taxonomy_match = false;
foreach ((array) $page_taxonomies as $taxonomy => $values) {
// if taxonomies filter set, make sure taxonomy filter is valid
if (is_array($taxonomies) && !empty($taxonomies) && !in_array($taxonomy, $taxonomies)) {
if (!is_array($values) || (is_array($taxonomies) && !empty($taxonomies) && !in_array($taxonomy, $taxonomies))) {
continue;
}

Expand Down

0 comments on commit 8a42f06

Please sign in to comment.