From 2ff3385788a4e259053ebc875da79a64b2723d6d Mon Sep 17 00:00:00 2001 From: Aleksander Machniak <alec@alec.pl> Date: Sun, 18 Oct 2015 03:45:33 -0400 Subject: [PATCH] Fix warning when enchant_broker_list_dicts() does not return an array --- program/lib/Roundcube/rcube_spellcheck_enchant.php | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/program/lib/Roundcube/rcube_spellcheck_enchant.php b/program/lib/Roundcube/rcube_spellcheck_enchant.php index 3876fee..437a492 100644 --- a/program/lib/Roundcube/rcube_spellcheck_enchant.php +++ b/program/lib/Roundcube/rcube_spellcheck_enchant.php @@ -40,9 +40,10 @@ $this->init(); $langs = array(); - $dicts = enchant_broker_list_dicts($this->enchant_broker); - foreach ($dicts as $dict) { - $langs[] = preg_replace('/-.*$/', '', $dict['lang_tag']); + if ($dicts = enchant_broker_list_dicts($this->enchant_broker)) { + foreach ($dicts as $dict) { + $langs[] = preg_replace('/-.*$/', '', $dict['lang_tag']); + } } return array_unique($langs); -- Gitblit v1.9.1