Summary | Horde_Imap_Client_Search_Query with empty ids object |
Queue | Horde Framework Packages |
Type | Bug |
State | Resolved |
Priority | 1. Low |
Owners | slusarz (at) horde (dot) org |
Requester | mrubinsk (at) horde (dot) org |
Created | 04/29/2015 (3717 days ago) |
Due | |
Updated | 04/29/2015 (3717 days ago) |
Assigned | |
Resolved | 04/29/2015 (3717 days ago) |
Github Issue Link | |
Github Pull Request | |
Milestone | |
Patch | No |
Assigned to Michael Slusarz
State ⇒ Resolved
commit bcd1cd251eb2670d4e3bcfec58aeb8ddc17ba3ff
Author: Michael M Slusarz <slusarz@horde.org>
Date: Wed Apr 29 14:14:21 2015 -0600
[mms] Fix search queries where ID list given is explicitly empty,
indicating that a match can never be successful (
Bug #13971)..../Imap_Client/lib/Horde/Imap/Client/Base.php | 46 ++++--
.../lib/Horde/Imap/Client/Search/Query.php | 159
++++++++++++++------
framework/Imap_Client/package.xml | 2 +
.../test/Horde/Imap/Client/SearchTest.php | 47 ++++++-
4 files changed, 193 insertions(+), 61 deletions(-)
http://github.com/horde/horde/commit/bcd1cd251eb2670d4e3bcfec58aeb8ddc17ba3ff
Priority ⇒ 1. Low
Patch ⇒ No
Milestone ⇒
Queue ⇒ Horde Framework Packages
Summary ⇒ Horde_Imap_Client_Search_Query with empty ids object
Type ⇒ Bug
State ⇒ Unconfirmed
results should belong to, and that id set is empty, the ids object is
ignored. I.e.:
$q = new Horde_Imap_Client_Search_Query();
$q->dateSearch(new Horde_Date(1427907906),
Horde_Imap_Client_Search_Query::DATE_BEFORE);
// Obviously a contrived example. $ids in this case would come from
some stored id list that may or may not contain any messages.
$ids = new Horde_Imap_Client_Ids(array());
$q->ids($ids);
$res = $imapOb()->search(
new Horde_Imap_Client_Mailbox('sent-mail-may-2011'),
$q,
array('results' => array(Horde_Imap_Client::SEARCH_RESULTS_MATCH)));
I would expect that this would return an empty result set, ideally
short-circuiting the actual search since we know nothing could
possibly match. Granted, we could check this in client code, but
nothing in the phpdoc of Horde_Imap_Client would lead me to believe
that this would be necessary.