r60054 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r60053‎ | r60054 | r60055 >
Date:00:11, 15 December 2009
Author:simetrical
Status:ok
Tags:
Comment:
maxlength=200 for page move summary in HTML5

Bug 16921. maxlength is not allowed on textareas in HTML4, so this only
works in HTML5. Note that Firefox 3.5 and Opera 9.22 ignore the
attribute (didn't test IE), so this isn't a complete fix. Recent WebKit
does respect the attribute (tested in Chrome 4).

Of course, the length limit of 200 is a hack, just like for edit
summaries, and we really need to move to a non-varchar(255) backend for
all these fields.

Relevant to r45517, r45571.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/Html.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialMovepage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Html.php
@@ -134,6 +134,9 @@
135135 unset( $attribs['type'] );
136136 }
137137 }
 138+ if ( $element == 'textarea' && isset( $attribs['maxlength'] ) ) {
 139+ unset( $attribs['maxlength'] );
 140+ }
138141 # Here we're blacklisting some HTML5-only attributes...
139142 $html5attribs = array(
140143 'autocomplete',
Index: trunk/phase3/includes/specials/SpecialMovepage.php
@@ -218,7 +218,8 @@
219219 Xml::label( wfMsg( 'movereason' ), 'wpReason' ) .
220220 "</td>
221221 <td class='mw-input'>" .
222 - Xml::tags( 'textarea', array( 'name' => 'wpReason', 'id' => 'wpReason', 'cols' => 60, 'rows' => 2 ), htmlspecialchars( $this->reason ) ) .
 222+ Html::element( 'textarea', array( 'name' => 'wpReason', 'id' => 'wpReason', 'cols' => 60, 'rows' => 2,
 223+ 'maxlength' => 200 ), $this->reason ) .
223224 "</td>
224225 </tr>"
225226 );
Index: trunk/phase3/RELEASE-NOTES
@@ -218,6 +218,7 @@
219219 ** Unnecessary type="" attribute removed for CSS and JS.
220220 ** If $wgWellFormedXml is set to false, some bytes will be shaved off of HTML
221221 output by omitting some things like quotation marks where HTML 5 allows.
 222+** (bug 16921) maxlength enabled for page move comments
222223 * The description message in $wgExtensionCredits can be an array with parameters
223224 * New hook SpecialRandomGetRandomTitle allows extensions to modify the selection
224225 criteria used by Special:Random and subclasses, or substitute a custom result,

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r45517* (bug 16921) Add a maxlength for the reason field of the page move form...raymond20:34, 7 January 2009
r45571Reverted r45517 " * (bug 16921) Add a maxlength for the reason field of the p...brion18:51, 8 January 2009

Status & tagging log