Skip to content

Commit 96725be

Browse files
committed
Custom and X-Spam search criteria fixed (#296)
1 parent 9b4a7cd commit 96725be

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/IMAP/Query/WhereQuery.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,8 @@ public function __call($name, $arguments) {
103103
*/
104104
protected function validate_criteria($criteria) {
105105
$criteria = strtoupper($criteria);
106-
107-
if (substr($criteria, 0, 6) === "CUSTOM") {
108-
return substr($criteria, 6);
106+
if (substr($criteria, 0, 7) === "CUSTOM ") {
107+
return substr($criteria, 7);
109108
}
110109
if(in_array($criteria, $this->available_criteria) === false) {
111110
throw new InvalidWhereQueryCriteriaException();
@@ -403,15 +402,15 @@ public function whereUnseen() {
403402
* @throws InvalidWhereQueryCriteriaException
404403
*/
405404
public function whereNoXSpam(){
406-
return $this->where("X-Spam-Flag NO");
405+
return $this->where("CUSTOM X-Spam-Flag NO");
407406
}
408407

409408
/**
410409
* @return WhereQuery
411410
* @throws InvalidWhereQueryCriteriaException
412411
*/
413412
public function whereIsXSpam(){
414-
return $this->where("X-Spam-Flag YES");
413+
return $this->where("CUSTOM X-Spam-Flag YES");
415414
}
416415

417416
/**

0 commit comments

Comments
 (0)