aboutsummaryrefslogtreecommitdiffstats
path: root/includes/htmlform/fields/HTMLMultiSelectField.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/htmlform/fields/HTMLMultiSelectField.php')
-rw-r--r--includes/htmlform/fields/HTMLMultiSelectField.php10
1 files changed, 6 insertions, 4 deletions
diff --git a/includes/htmlform/fields/HTMLMultiSelectField.php b/includes/htmlform/fields/HTMLMultiSelectField.php
index a34978d17b8b..26e7ca96bd05 100644
--- a/includes/htmlform/fields/HTMLMultiSelectField.php
+++ b/includes/htmlform/fields/HTMLMultiSelectField.php
@@ -162,7 +162,7 @@ class HTMLMultiSelectField extends HTMLFormField implements HTMLNestedFilterable
$optionsOouiSections
);
}
- '@phan-var array[] $optionsOouiSections';
+ '@phan-var array[][] $optionsOouiSections';
$out = [];
foreach ( $optionsOouiSections as $sectionLabel => $optionsOoui ) {
@@ -170,16 +170,18 @@ class HTMLMultiSelectField extends HTMLFormField implements HTMLNestedFilterable
$attr['name'] = "{$this->mName}[]";
$attr['value'] = $value;
- $attr['options'] = $optionsOoui;
- foreach ( $attr['options'] as &$option ) {
+ $options = $optionsOoui;
+ foreach ( $options as &$option ) {
$option['disabled'] = in_array( $option['data'], $this->mParams['disabled-options'], true );
}
if ( $this->mOptionsLabelsNotFromMessage ) {
- foreach ( $attr['options'] as &$option ) {
+ foreach ( $options as &$option ) {
$option['label'] = new OOUI\HtmlSnippet( $option['label'] );
}
}
+ unset( $option );
+ $attr['options'] = $options;
$attr += OOUI\Element::configFromHtmlAttributes(
$this->getAttributes( [ 'disabled', 'tabindex' ] )