From 248a1e6b3c441c14eb890e85fe15c2b9af353d73 Mon Sep 17 00:00:00 2001 From: ggoffy Date: Thu, 21 May 2020 08:19:09 +0200 Subject: [PATCH] fixed warning --- include/search.inc.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/include/search.inc.php b/include/search.inc.php index d53bec1..eda7492 100644 --- a/include/search.inc.php +++ b/include/search.inc.php @@ -52,6 +52,7 @@ function wggallery_search($queryarray, $andor, $limit, $offset, $userid) if (is_array($queryarray)) { $count = count($queryarray); } + if (is_array($queryarray) && $count > 0) { $criteriaKeywords = new CriteriaCompo(); $elementCount = count($queryarray); @@ -75,10 +76,10 @@ function wggallery_search($queryarray, $andor, $limit, $offset, $userid) } $critSearch = new CriteriaCompo(); - if (null !== $criteriaUser) { + if (isset($criteriaUser)) { $critSearch->add($criteriaUser, 'AND'); } - if (null !== $criteriaKeywords) { + if (isset($criteriaKeywords)) { $critSearch->add($criteriaKeywords, 'AND'); } $critSearch->setLimit($limit); @@ -122,10 +123,10 @@ function wggallery_search($queryarray, $andor, $limit, $offset, $userid) } $critSearch = new CriteriaCompo(); - if (null !== $criteriaUser) { + if (isset($criteriaUser)) { $critSearch->add($criteriaUser, 'AND'); } - if (null !== $criteriaKeywords) { + if (isset($criteriaKeywords)) { $critSearch->add($criteriaKeywords, 'AND'); } $critSearch->setLimit($limit);