From: jangliss Date: Wed, 22 Feb 2006 05:27:05 +0000 (+0000) Subject: Fix warning about array_keys requiring an array as an argument when X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=bed0ac1d02119b343a009f8c6932b73954fb86f1;p=squirrelmail.git Fix warning about array_keys requiring an array as an argument when fontsets are not defined in the config. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@10807 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- diff --git a/ChangeLog b/ChangeLog index e98092dd..e8d1221d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,7 +3,8 @@ ************************************* Version 1.5.2 CVS - - + - Fix warning about array required in array_keys for display options when + no fontset is defined. Version 1.5.1 (branched on 2006-02-12) -------------------------------------- diff --git a/include/options/display.php b/include/options/display.php index 573f2ba4..60a500c9 100644 --- a/include/options/display.php +++ b/include/options/display.php @@ -128,10 +128,15 @@ function load_optpage_data_display() { */ $fontset_values = array(); - foreach (array_keys($fontsets) as $fontset_key) { - $fontset_list[$fontset_key]=$fontset_key; + $fontset_list = array(); + + if (!empty($fontsets) && is_array($fontsets)) { + + foreach (array_keys($fontsets) as $fontset_key) { + $fontset_list[$fontset_key]=$fontset_key; + } + ksort($fontset_list); } - ksort($fontset_list); if (count($fontset_list) > 1) { $fontset_list = array_merge(array('' => _("Default font style")), $fontset_list); @@ -488,4 +493,4 @@ function icon_theme_save($option) { } -?> \ No newline at end of file +?>