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:03:46 +00:00
parent b5c73dd734
commit ec1d39a7a9

View File

@ -1539,7 +1539,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];
}
@ -1566,7 +1566,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];
}