Skip to content

Commit 322b296

Browse files
committed
Force to add a space between criteria in search query, otherwise no messages are fetched.
1 parent 3199918 commit 322b296

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) princip
66

77
## [UNRELEASED]
88
### Fixed
9-
- NaN
9+
- Force to add a space between criteria in search query, otherwise no messages are fetched. Thanks to @cent89
1010

1111
### Added
1212
- NaN
1313

1414
### Affected Classes
15-
- NaN
15+
- [Folder::class](src/IMAP/Folder.php)
1616

1717
## [1.1.0] - 2018-04-24
1818
### Fixed

src/IMAP/Folder.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,8 +285,11 @@ public function searchMessages(array $where, $fetch_options = null, $fetch_body
285285
}
286286
$query .= $statement[0].' "'.$value.'"';
287287
}
288+
$query .= ' ';
288289
}
289290

291+
$query = trim($query);
292+
290293
$availableMessages = imap_search($this->getClient()->getConnection(), $query, SE_UID, $charset);
291294

292295
if ($availableMessages !== false) {
@@ -377,6 +380,8 @@ protected function parseAttributes($attributes) {
377380
* Delete the current Mailbox
378381
*
379382
* @return bool
383+
*
384+
* @throws Exceptions\ConnectionFailedException
380385
*/
381386
public function delete() {
382387
$status = imap_deletemailbox($this->client->getConnection(), $this->path);
@@ -391,6 +396,8 @@ public function delete() {
391396
* @param string $target_mailbox
392397
*
393398
* @return bool
399+
*
400+
* @throws Exceptions\ConnectionFailedException
394401
*/
395402
public function move($target_mailbox) {
396403
$status = imap_renamemailbox($this->client->getConnection(), $this->path, $target_mailbox);

0 commit comments

Comments
 (0)