[Tickets #13971] Horde_Imap_Client_Search_Query with empty ids object

noreply at bugs.horde.org noreply at bugs.horde.org
Wed Apr 29 18:11:22 UTC 2015


DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.

Ticket URL: https://bugs.horde.org/ticket/13971
------------------------------------------------------------------------------
  Ticket             | 13971
  Created By         | Michael Rubinsky <mrubinsk at horde.org>
  Summary            | Horde_Imap_Client_Search_Query with empty ids object
  Queue              | Horde Framework Packages
  Type               | Bug
  State              | Unconfirmed
  Priority           | 1. Low
  Milestone          |
  Patch              |
  Owners             |
------------------------------------------------------------------------------


Michael Rubinsky <mrubinsk at horde.org> (2015-04-29 18:11) wrote:

When performing a search and the search includes an id set that the  
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.





More information about the bugs mailing list