From 0e79acf6a97a2939ad08029c63e164b642668a89 Mon Sep 17 00:00:00 2001 From: Happy-melon Date: Sat, 18 Dec 2010 16:25:14 +0000 Subject: [PATCH] r52070 breaks the use of optgroups etc: array(...) is cast to 'Array'. Need to only cast integers to strings. --- includes/HTMLForm.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/includes/HTMLForm.php b/includes/HTMLForm.php index 0952ebf6af..fbb17d4b44 100644 --- a/includes/HTMLForm.php +++ b/includes/HTMLForm.php @@ -1222,7 +1222,10 @@ class HTMLSelectField extends HTMLFormField { # If one of the options' 'name' is int(0), it is automatically selected. # because PHP sucks and things int(0) == 'some string'. # Working around this by forcing all of them to strings. - $options = array_map( 'strval', $this->mParams['options'] ); + $options = array_map( + create_function('$opt', 'return is_int($opt) ? strval($opt) : $opt;'), + $this->mParams['options'] + ); if ( !empty( $this->mParams['disabled'] ) ) { $select->setAttribute( 'disabled', 'disabled' ); -- 2.20.1