Fix PHP warning: count(): Parameter must be an array or an object... in ID command handler (#7392)

bnet/additions
Aleksander Machniak 5 years ago
parent eba6fb20cf
commit c25616b3b5

@ -9,6 +9,7 @@ CHANGELOG Roundcube Webmail
- Password: Fix issue with Modoboa driver (#7372) - Password: Fix issue with Modoboa driver (#7372)
- Mailvelope: Use sender's address to find pubkeys to check signatures (#7348) - Mailvelope: Use sender's address to find pubkeys to check signatures (#7348)
- Mailvelope: Fix Encrypt button hidden in Elastic (#7353) - Mailvelope: Fix Encrypt button hidden in Elastic (#7353)
- Fix PHP warning: count(): Parameter must be an array or an object... in ID command handler (#7392)
RELEASE 1.4.4 RELEASE 1.4.4
------------- -------------

@ -1742,7 +1742,7 @@ class rcube_imap_generic
* *
* @param array $items Client identification information key/value hash * @param array $items Client identification information key/value hash
* *
* @return array Server identification information key/value hash * @return array|false Server identification information key/value hash, False on error
* @since 0.6 * @since 0.6
*/ */
public function id($items = array()) public function id($items = array())
@ -1761,10 +1761,12 @@ class rcube_imap_generic
if ($code == self::ERROR_OK && $response) { if ($code == self::ERROR_OK && $response) {
$response = substr($response, 5); // remove prefix "* ID " $response = substr($response, 5); // remove prefix "* ID "
$items = $this->tokenizeResponse($response, 1); $items = $this->tokenizeResponse($response, 1);
$result = null; $result = array();
for ($i=0, $len=count($items); $i<$len; $i += 2) { if (is_array($items)) {
$result[$items[$i]] = $items[$i+1]; for ($i=0, $len=count($items); $i<$len; $i += 2) {
$result[$items[$i]] = $items[$i+1];
}
} }
return $result; return $result;

Loading…
Cancel
Save