Skip to content

Commit 291201c

Browse files
committed
serach criteria validation fixed
1 parent 4d95aa1 commit 291201c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/IMAP/Folder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ public function searchMessages(array $where, $fetch_options = null, $parse_body
260260

261261
$this->getClient()->checkConnection();
262262

263-
if($this->validateWhereStatements($where)){
263+
if($this->validateWhereStatements($where) === false){
264264
throw new MessageSearchValidationException('Invalid imap search criteria provided');
265265
}
266266

@@ -311,7 +311,7 @@ public function searchMessages(array $where, $fetch_options = null, $parse_body
311311
protected function validateWhereStatements($statements){
312312
foreach($statements as $statement){
313313
$criteria = $statement[0];
314-
if(in_array(explode($criteria, ' '), [
314+
if(in_array($criteria, [
315315
'OR', 'AND',
316316
'ALL', 'ANSWERED', 'BCC', 'BEFORE', 'BODY', 'CC', 'DELETED', 'FLAGGED', 'FROM', 'KEYWORD',
317317
'NEW', 'OLD', 'ON', 'RECENT', 'SEEN', 'SINCE', 'SUBJECT', 'TEXT', 'TO',

0 commit comments

Comments
 (0)