<?xml version="1.0" encoding="UTF-8"?> 
<?xml-stylesheet href="https://dev.horde.org/themes/horde//default/feed-rss.xsl" type="text/xsl"?> 
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> 
 <channel> 
  <title>Searching for unseen messages doesn&#039;t work: Undefined index: unseen</title> 
  <pubDate>Fri, 10 Apr 2026 14:48:33 +0000</pubDate> 
  <link>https://bugs.horde.org/ticket/7596</link> 
  <atom:link rel="self" type="application/rss+xml" title="Searching for unseen messages doesn&#039;t work: Undefined index: unseen" href="https://bugs.horde.org/ticket/7596/rss" /> 
  <description>Searching for unseen messages doesn&#039;t work: Undefined index: unseen</description> 
 
   
   
  <item> 
   <title>When I try to search unseen messages in my IMAP folders, thi</title> 
   <description>When I try to search unseen messages in my IMAP folders, this is all I get:



Notice: Undefined index: unseen in /var/www/horde33/imp/search.php on line 73



Warning: Cannot modify header information - headers already sent by (output started at /var/www/horde33/imp/search.php:73) in /var/www/horde33/imp/search.php on line 96

</description> 
   <pubDate>Tue, 28 Oct 2008 17:58:18 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7596#t50112</link> 
  </item> 
   
  <item> 
   <title>I can&#039;t reproduce this with 4.3-CVS, and no changes have bee</title> 
   <description>I can&#039;t reproduce this with 4.3-CVS, and no changes have been made to that code since 4.3.0.</description> 
   <pubDate>Thu, 06 Nov 2008 02:09:23 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7596#t50318</link> 
  </item> 
   
  <item> 
   <title>&gt; I can&#039;t reproduce this with 4.3-CVS, and no changes have b</title> 
   <description>&gt; I can&#039;t reproduce this with 4.3-CVS, and no changes have been made to 

&gt; 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&#039;s enough adding these lines at end of horde/config/conf.php:

$conf[&#039;compress_pages&#039;] = false;

$conf[&#039;debug_level&#039;] = 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 &quot;unseen&quot; in $search[&#039;field&#039;][$i]. $imp_search_fields receives an array from $imp_search-&gt;searchFields(), that is defined in imp/lib/Search.php at line 702. The problem occurs because the returned array doesn&#039;t define the index &#039;unseen&#039;.



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&#039;t assume user input is a valid integer. By example, IMP should throw an error if an user tries to search messages with &quot;size &gt;= k1024abc&quot;...</description> 
   <pubDate>Sat, 08 Nov 2008 18:18:08 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7596#t50481</link> 
  </item> 
   
  <item> 
   <title>Can&#039;t reproduce.  And we already cast any data passed in to </title> 
   <description>Can&#039;t reproduce.  And we already cast any data passed in to an integer.  See line 938 of imp/lib/Search.php:

$ob-&gt;size(intval($search[&#039;text&#039;][$key]), ($val == &#039;size_larger&#039;) ? &#039;&gt;&#039; : &#039;&lt;&#039;);</description> 
   <pubDate>Wed, 03 Dec 2008 06:43:20 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7596#t51052</link> 
  </item> 
   
  <item> 
   <title>&gt; Can&#039;t reproduce.  And we already cast any data passed in t</title> 
   <description>&gt; Can&#039;t reproduce.  And we already cast any data passed in to an 

&gt; integer.  See line 938 of imp/lib/Search.php:

&gt; $ob-&gt;size(intval($search[&#039;text&#039;][$key]), ($val == &#039;size_larger&#039;) ? 

&gt; &#039;&gt;&#039; : &#039;&lt;&#039;);



Ok, ok... The problem in the size field is not important here...

My headache occurs because I still can&#039;t look for unseen messages without enabling compression in Horde.



Please, try to reproduce the searching bug using my configuration (attached). You will need a MySQL server and a GMail account with IMAP enabled.</description> 
   <pubDate>Wed, 03 Dec 2008 12:59:36 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7596#t51059</link> 
  </item> 
   
  <item> 
   <title>And please, reopen this bug, because it&#039;s still present in m</title> 
   <description>And please, reopen this bug, because it&#039;s still present in my system!</description> 
   <pubDate>Wed, 03 Dec 2008 19:40:56 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7596#t51062</link> 
  </item> 
   
  <item> 
   <title>Humm... The bug was fixed in revision 2.128.2.33...



http:</title> 
   <description>Humm... The bug was fixed in revision 2.128.2.33...



http://cvs.horde.org/co.php/imp/search.php?r=2.128.2.33



I don&#039;t see the bug in IMP 4.3.4.</description> 
   <pubDate>Thu, 30 Apr 2009 16:48:40 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7596#t53956</link> 
  </item> 
   
   
 
 </channel> 
</rss> 
