From e9b2213a7b318d5c3a3ccdfce99ddc0f348ec558 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Mon, 20 Aug 2012 18:50:10 +0000 Subject: [PATCH] 2012-08-20 Miguel de Dios * include/functions_html.php: fixed into the function "html_print_select" when pass a grouped array and try to sort. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6892 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 5 +++++ pandora_console/include/functions_html.php | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index c47be74402..6bff9e4447 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,8 @@ +2012-08-20 Miguel de Dios + + * include/functions_html.php: fixed into the function + "html_print_select" when pass a grouped array and try to sort. + 2012-08-20 Miguel de Dios * index.php, extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql, diff --git a/pandora_console/include/functions_html.php b/pandora_console/include/functions_html.php index 204763f005..b43850bef4 100644 --- a/pandora_console/include/functions_html.php +++ b/pandora_console/include/functions_html.php @@ -302,7 +302,9 @@ function html_print_select ($fields, $name, $selected = '', $script = '', if (is_array($fields) && !empty ($fields)) { if ($sort !== false) { // Sorting the fields in natural way and case insensitive preserving keys - uasort($fields, "strnatcasecmp"); + $first_elem = reset($fields); + if (!is_array($first_elem)) + uasort($fields, "strnatcasecmp"); } $lastopttype = ''; foreach ($fields as $value => $label) {