From: robin Date: Sat, 18 Aug 2012 01:32:51 +0000 (+0200) Subject: Add 'list' to allowed input attributes in HTMLForm X-Git-Tag: 1.31.0-rc.0~22688^2 X-Git-Url: http://git.cyclocoop.org/%22.%24image2.%22?a=commitdiff_plain;h=e5abc04c03599d000f3760e3c9535198e37cb85c;p=lhc%2Fweb%2Fwiklou.git 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 --- 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]; }