[imp] Horde/Imap/Client/Mailbox.php and ===

Michael M Slusarz slusarz at horde.org
Thu Sep 19 17:19:02 UTC 2013


Quoting Bartek Krajnik <bartek at bmk-it.com>:

> Hi,
> below patch to resolve issue with:
> PHP Fatal error:  Method Horde_Imap_Client_Mailbox::__toString()  
> must not throw an exception in  
> /usr/lib/php/Horde/Imap/Client/Socket.php on line 0
>
> root at a:/var/www/poczta/public_html# diff  
> /usr/lib/php/Horde/Imap/Client/Mailbox.php.orig  
> /usr/lib/php/Horde/Imap/Client/Mailbox.php
> 71c71,72
> <         if (strcasecmp($mbox, 'INBOX') === 0) {
> ---
>>         //if (strcasecmp($mbox, 'INBOX') === 0) {
>>         if (strcasecmp($mbox, 'INBOX') == 0) {

This is incorrect.  strcasecmp() MUST return an integer.  So === is  
appropriate here.

> 98c99,100
> <             return ($this->_utf7imap === true)
> ---
>>             //return ($this->_utf7imap === true)
>>             return ($this->_utf7imap == true)

Absolutely not.  $_utf7imap boolean true has a meaning *completely*  
different than $_utf7imap having a non-empty value.

I don't know what problem you are trying to fix, because you haven't  
provided a backtrace.

michael

___________________________________
Michael Slusarz [slusarz at horde.org]



More information about the imp mailing list