Fix PHP 7.2 warnings on count() use (#5845)

pull/5847/head
Aleksander Machniak 7 years ago
parent 97bf251dc6
commit e04f72d018

@ -41,6 +41,7 @@ CHANGELOG Roundcube Webmail
- Fix position of selected icon for (Mailvelope) Encrypt button
- Fix fatal error when using DMY- or MDY-based date format in PostgreSQL (#5808)
- Fix bug where errors were not printed when using bin/update.sh (#5834)
- Fix PHP 7.2 warnings on count() use (#5845)
RELEASE 1.3.0
-------------

@ -364,7 +364,7 @@ class rcube_contacts extends rcube_addressbook
// count result pages
$cnt = $this->count()->count;
$pages = ceil($cnt / $this->page_size);
$scnt = count($post_search);
$scnt = !empty($post_search) ? count($post_search) : 0;
// get (paged) result
for ($i=0; $i<$pages; $i++) {

@ -133,7 +133,7 @@ class rcube_db_oracle extends rcube_db
$idx = 0;
$args = array();
if (count($params)) {
if (!empty($params)) {
while ($pos = strpos($query, '?', $pos)) {
if ($query[$pos+1] == '?') { // skip escaped '?'
$pos += 2;

@ -1250,7 +1250,7 @@ class rcube_imap_generic
}
list($code, $response) = $this->execute('STATUS', array($this->escape($mailbox),
'(' . implode(' ', (array) $items) . ')'));
'(' . implode(' ', $items) . ')'));
if ($code == self::ERROR_OK && preg_match('/^\* STATUS /i', $response)) {
$result = array();
@ -1263,11 +1263,11 @@ class rcube_imap_generic
if (!is_array($items) && ($pos = strpos($response, '(')) !== false) {
$response = substr($response, $pos);
$items = $this->tokenizeResponse($response, 1);
}
if (!is_array($items)) {
return $result;
}
}
for ($i=0, $len=count($items); $i<$len; $i += 2) {
$result[$items[$i]] = $items[$i+1];

@ -435,6 +435,7 @@ class rcube_plugin_api
array_push($this->exec_stack, $hook);
// Use for loop here, so handlers added in the hook will be executed too
if (!empty($this->handlers[$hook])) {
for ($i = 0; $i < count($this->handlers[$hook]); $i++) {
$ret = call_user_func($this->handlers[$hook][$i], $args);
if ($ret && is_array($ret)) {
@ -445,6 +446,7 @@ class rcube_plugin_api
break;
}
}
}
array_pop($this->exec_stack);
return $args;

Loading…
Cancel
Save