Fix PHP Warning: array_filter() expects parameter 1 to be array, null given in subscription_options plugin (#7165)

.. when IMAP connection fails
pull/6781/merge
Aleksander Machniak 4 years ago
parent 355ff138fd
commit e3556986a1

@ -12,6 +12,7 @@ CHANGELOG Roundcube Webmail
- Elastic: Fix bug where it was possible to switch editor mode when 'htmleditor' was in 'dont_override' (#7143)
- Fix so messages in threads with no root aren't displayed separately (#4999)
- Fix regression where "Open in new window" action didn't work (#7155)
- Fix PHP Warning: array_filter() expects parameter 1 to be array, null given in subscriptions_option plugin (#7165)
RELEASE 1.4.2
-------------

@ -79,13 +79,15 @@ class subscriptions_option extends rcube_plugin
if (!$rcmail->config->get('use_subscriptions', true)) {
$storage = $rcmail->get_storage();
$folders = $storage->list_folders_direct();
$folders = array_filter($folders, function($folder) use ($storage) {
$attrs = $storage->folder_attributes($folder);
return !in_array_nocase('\\Noselect', $attrs);
});
$args['folders'] = $folders;
if ($folders = $storage->list_folders_direct()) {
$folders = array_filter($folders, function($folder) use ($storage) {
$attrs = $storage->folder_attributes($folder);
return !in_array_nocase('\\Noselect', $attrs);
});
$args['folders'] = $folders;
}
}
return $args;

Loading…
Cancel
Save