From 3b8bc8f28118fd37ae320c9cbc9dc1d4511c7e3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9F=D0=B0=D0=B2=D0=B5=D0=BB?= Date: Tue, 26 May 2020 18:00:38 +0300 Subject: [PATCH] Closes #119 - prevent search with empty email --- src/include/class-wc-retailcrm-customers.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/include/class-wc-retailcrm-customers.php b/src/include/class-wc-retailcrm-customers.php index 263e59a..06eb1d1 100644 --- a/src/include/class-wc-retailcrm-customers.php +++ b/src/include/class-wc-retailcrm-customers.php @@ -175,6 +175,10 @@ if (!class_exists('WC_Retailcrm_Customers')) : if (isset($filter['externalId'])) { $search = $this->retailcrm->customersGet($filter['externalId']); } elseif (isset($filter['email'])) { + if (empty($filter['email']) && count($filter) == 1) { + return false; + } + $search = $this->retailcrm->customersList(array('email' => $filter['email'])); }