$validOptions = HTMLFormField::flattenOptions( $this->getOptions() );
- if ( in_array( $value, $validOptions ) ) {
+ if ( in_array( strval( $value ), $validOptions, true ) ) {
return true;
} else {
return $this->msg( 'htmlform-select-badoption' )->parse();
* This returns a block of all the radio options, in one cell.
* @see includes/HTMLFormField#getInputHTML()
*
- * @param $value String
+ * @param string $value
*
- * @return String
+ * @return string
*/
function getInputHTML( $value ) {
- $html = $this->formatOptions( $this->getOptions(), $value );
+ $html = $this->formatOptions( $this->getOptions(), strval( $value ) );
return $html;
}
$html .= $this->formatOptions( $info, $value );
} else {
$id = Sanitizer::escapeId( $this->mID . "-$info" );
- $radio = Xml::radio( $this->mName, $info, $info == $value, $attribs + array( 'id' => $id ) );
+ $radio = Xml::radio( $this->mName, $info, $info === $value, $attribs + array( 'id' => $id ) );
$radio .= ' ' . call_user_func( $elementFunc, 'label', array( 'for' => $id ), $label );
$html .= ' ' . Html::rawElement(