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

.. when IMAP connection fails
bnet/additions
Aleksander Machniak 5 years ago
parent c8ead80312
commit b5e76ab202

@ -5,6 +5,7 @@ CHANGELOG Roundcube Webmail
- Password: Make chpass-wrapper.py Python 3 compatible (#7135)
- Elastic: Fix bug where it was possible to switch editor mode when 'htmleditor' was in 'dont_override' (#7143)
- 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