[Tickets #7596] Re: Searching for unseen messages doesn't work: Undefined index: unseen

bugs at horde.org bugs at horde.org
Sat Nov 8 18:18:08 UTC 2008


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

Ticket URL: http://bugs.horde.org/ticket/7596
------------------------------------------------------------------------------
  Ticket             | 7596
  Updated By         | amg1127 at cefetrs.tche.br
  Summary            | Searching for unseen messages doesn't work: Undefined
                     | index: unseen
  Queue              | IMP
  Version            | 4.3
  Type               | Bug
  State              | Feedback
  Priority           | 1. Low
  Milestone          |
  Patch              |
  Owners             |
------------------------------------------------------------------------------


amg1127 at cefetrs.tche.br (2008-11-08 13:18) wrote:

> I can't reproduce this with 4.3-CVS, and no changes have been made to
> that code since 4.3.0.

Sorry for my delay... I was trying to find a way to reproduce the bug  
in a new Horde+IMP installation.

In order to reproduce the bug, I think it's enough adding these lines  
at end of horde/config/conf.php:
$conf['compress_pages'] = false;
$conf['debug_level'] = E_ALL;

--------------

I investigated the source code... In imp/search.php, line 73, it tries  
to find integer search fields, in order to convert sizes from  
kilobytes to bytes. When an user specifies he wants to find unseen  
messages, the browser generates a field with value "unseen" in  
$search['field'][$i]. $imp_search_fields receives an array from  
$imp_search->searchFields(), that is defined in imp/lib/Search.php at  
line 702. The problem occurs because the returned array doesn't define  
the index 'unseen'.

I wish to do some suggestions:
# Track PHP errors with set_error_handler()  
(http://br.php.net/manual/en/function.set-error-handler.php), so Horde  
can optionally log errors in logfile or display PHP errors, even if  
there is an output handler capturing output.
# In imp/search.php, line 74, IMP shouldn't assume user input is a  
valid integer. By example, IMP should throw an error if an user tries  
to search messages with "size >= k1024abc"...





More information about the bugs mailing list