6.0.0-alpha14
6/25/25

[#1623] undefined index error in IMP.php, line 585
Summary undefined index error in IMP.php, line 585
Queue IMP
Queue Version 4.0.2
Type Bug
State Not A Bug
Priority 1. Low
Owners
Requester eli (at) experthost (dot) com
Created 03/25/2005 (7397 days ago)
Due
Updated 03/25/2005 (7397 days ago)
Assigned
Resolved 03/25/2005 (7397 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
03/25/2005 10:44:30 PM eli (at) experthost (dot) com Comment #5 Reply to this comment
Oh, I see :)  Wasn't even paying attention to that.
03/25/2005 08:32:52 PM Michael Slusarz Comment #4 Reply to this comment
If $filter is completely empty (meaning no filtering is wanted so that 
showing the mailbox in the list is pointless), !isset($filter[0]) will 
return true and you will be setting $showmbox incorrectly and doing an 
array_shift() on an empty array.
03/25/2005 03:47:08 PM eli (at) experthost (dot) com Comment #3 Reply to this comment
Ah, my apologies - I did a few searches and didn't see another report of this.



However, is my fix not a better one?  using !isset($filter[0]) takes 
in to consideration that $filter could be entirely empty, or that 
$filter[0] is empty (null, or o, or false), whereas adding 
count($filter) requires $filter to have an item in it, and you're 
running 2 functions rather than just 1.
03/25/2005 04:47:16 AM Michael Slusarz Comment #2
State ⇒ Not A Bug
Reply to this comment
Duplicate of Bug #1367.
03/25/2005 04:39:29 AM eli (at) experthost (dot) com Comment #1
State ⇒ Unconfirmed
Priority ⇒ 1. Low
Type ⇒ Bug
Summary ⇒ undefined index error in IMP.php, line 585
Queue ⇒ IMP
Reply to this comment
I see errors about an undefined index in IMP.php on line 585 which is 
the line using "is_null($filter[0])":



         /* Add the list of mailboxes to the lists. */

         $showmbox = false;

         if (is_null($filter[0])) {

             $showmbox = true;

             array_shift($filter);

         }



If you change the is_null() call to !isset() you eliminate the 
undefined index error and get the same functionality.



Eli.

Saved Queries