From de003a1edc59868ea9be8775b589253ebfcf58e5 Mon Sep 17 00:00:00 2001 From: Andrew Garrett Date: Fri, 24 Apr 2009 08:58:19 +0000 Subject: [PATCH] Update HTMLSelectOrOtherField to correctly work, since the code changes of having "nested" options and swapping keys and values --- includes/HTMLForm.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/includes/HTMLForm.php b/includes/HTMLForm.php index 44aec19409..b41dc4bd75 100644 --- a/includes/HTMLForm.php +++ b/includes/HTMLForm.php @@ -591,7 +591,8 @@ class HTMLSelectOrOtherField extends HTMLTextField { $valInSelect = false; if ($value !== false) - $valInSelect = array_key_exists( $value, $this->mParams['options'] ); + $valInSelect = in_array( $value, + HTMLFormField::flattenOptions($this->mParams['options']) ); $selected = $valInSelect ? $value : 'other'; -- 2.20.1