fixed fatal error: Cannot use object of type PEAR_Error as array, happening eg. if no or wrong credentials

This commit is contained in:
Ralf Becker 2010-08-18 10:04:08 +00:00
parent 4f16a9714d
commit 0ec25e276a

View File

@ -1529,7 +1529,7 @@ class Net_IMAPProtocol {
}
$mailbox_name=sprintf("%s",$this->utf_7_encode($mailbox_name) );
$ret = $this->_genericCommand('GETQUOTA', $mailbox_name );
if(isset( $ret["PARSED"] ) ){
if(!is_object($ret) && isset( $ret["PARSED"] ) ){
// remove the array index because the quota response returns only 1 line of output
$ret['PARSED']=$ret["PARSED"][0];
}
@ -1556,7 +1556,7 @@ class Net_IMAPProtocol {
$mailbox_name=sprintf("%s",$this->utf_7_encode($mailbox_name) );
$ret = $this->_genericCommand('GETQUOTAROOT', $mailbox_name );
if(isset( $ret["PARSED"] ) ){
if(!is_object($ret) && isset( $ret["PARSED"] ) ){
// remove the array index because the quota response returns only 1 line of output
$ret['PARSED']=$ret["PARSED"][1];
}