X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FXmlSelect.php;h=78f476452f80d3c6504206081475eefe2d56b0d8;hb=0a1c04beae41a7fe6f57152dfd7c0bc9261528e0;hp=e765eedbc33a10ad5dc674c68e2efc6e31e70d12;hpb=05ca0593bdab72be5ed83e2eb5cf80033557fafd;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/XmlSelect.php b/includes/XmlSelect.php index e765eedbc3..78f476452f 100644 --- a/includes/XmlSelect.php +++ b/includes/XmlSelect.php @@ -43,7 +43,7 @@ class XmlSelect { } /** - * @param string $default + * @param string|array $default */ public function setDefault( $default ) { $this->default = $default; @@ -95,7 +95,7 @@ class XmlSelect { * label => ( label => value, label => value ) * * @param array $options - * @param string $default + * @param string|array $default * @return string */ static function formatOptions( $options, $default = false ) { @@ -106,7 +106,11 @@ class XmlSelect { $contents = self::formatOptions( $value, $default ); $data .= Html::rawElement( 'optgroup', array( 'label' => $label ), $contents ) . "\n"; } else { - $data .= Xml::option( $label, $value, $value === $default ) . "\n"; + // If $default is an array, then the