aboutsummaryrefslogtreecommitdiffstats
path: root/includes/HTMLForm.php
diff options
context:
space:
mode:
authorHappy-melon <happy-melon@users.mediawiki.org>2010-12-18 16:25:14 +0000
committerHappy-melon <happy-melon@users.mediawiki.org>2010-12-18 16:25:14 +0000
commit0e79acf6a97a2939ad08029c63e164b642668a89 (patch)
tree4e7a91cb931511f228edd596407889ae93eca290 /includes/HTMLForm.php
parentc71e58f76f538d900da54b920618fc90bf60ab94 (diff)
downloadmediawikicore-0e79acf6a97a2939ad08029c63e164b642668a89.tar.gz
mediawikicore-0e79acf6a97a2939ad08029c63e164b642668a89.zip
r52070 breaks the use of optgroups etc: array(...) is cast to 'Array'. Need to only cast integers to strings.
Notes
Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/78566
Diffstat (limited to 'includes/HTMLForm.php')
-rw-r--r--includes/HTMLForm.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/includes/HTMLForm.php b/includes/HTMLForm.php
index 0952ebf6afe0..fbb17d4b44f8 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' );