From e5abc04c03599d000f3760e3c9535198e37cb85c Mon Sep 17 00:00:00 2001 From: robin Date: Sat, 18 Aug 2012 03:32:51 +0200 Subject: [PATCH] Add 'list' to allowed input attributes in HTMLForm Add 'list' (new in HTML5 as part of datalist) to the allowed input attributes in HTMLForm. Also move maxlength into the general foreach. Change-Id: I2ba61b0cc1b9f8b3db6c419efb5cbadfde594699 --- includes/HTMLForm.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/includes/HTMLForm.php b/includes/HTMLForm.php index e617f17516..db29436370 100644 --- a/includes/HTMLForm.php +++ b/includes/HTMLForm.php @@ -1527,18 +1527,15 @@ class HTMLTextField extends HTMLFormField { $attribs['class'] = $this->mClass; } - if ( isset( $this->mParams['maxlength'] ) ) { - $attribs['maxlength'] = $this->mParams['maxlength']; - } - if ( !empty( $this->mParams['disabled'] ) ) { $attribs['disabled'] = 'disabled'; } # TODO: Enforce pattern, step, required, readonly on the server side as # well - foreach ( array( 'min', 'max', 'pattern', 'title', 'step', - 'placeholder' ) as $param ) { + $allowedParams = array( 'min', 'max', 'pattern', 'title', 'step', + 'placeholder', 'list', 'maxlength' ); + foreach ( $allowedParams as $param ) { if ( isset( $this->mParams[$param] ) ) { $attribs[$param] = $this->mParams[$param]; } -- 2.20.1