From: Brian Wolff Date: Tue, 10 May 2011 05:36:15 +0000 (+0000) Subject: Prevent user from trying to move a page to a title longer than 255 bytes. X-Git-Tag: 1.31.0-rc.0~30298 X-Git-Url: http://git.cyclocoop.org/%22.%28%24lien.?a=commitdiff_plain;h=9376c84fa96a1be5c35d2c94f1946bfa22d6da3f;p=lhc%2Fweb%2Fwiklou.git Prevent user from trying to move a page to a title longer than 255 bytes. This just puts a maxlength on the field (+ byte counter js) which is much nicer and clearer feedback to the user if they went over the limit then: "The requested page title was invalid, empty, or an incorrectly linked inter-language or inter-wiki title. It may contain one or more characters which cannot be used in titles" Which doesn't exactly indicate a length error. --- diff --git a/RELEASE-NOTES-1.19 b/RELEASE-NOTES-1.19 index 198481982a..1c25609b65 100644 --- a/RELEASE-NOTES-1.19 +++ b/RELEASE-NOTES-1.19 @@ -27,6 +27,7 @@ file description page for multi-paged documents. used in Tiff files. * When translcuding a special page, do not let it interpret url parameters. * (bug 28887) Special page classes are no longer re-used during 1 request. +* New title field of Special:MovePage is now length limited on client side. === API changes in 1.19 === diff --git a/includes/specials/SpecialMovepage.php b/includes/specials/SpecialMovepage.php index df200a891d..b61f963f4a 100644 --- a/includes/specials/SpecialMovepage.php +++ b/includes/specials/SpecialMovepage.php @@ -229,7 +229,8 @@ class MovePageForm extends UnlistedSpecialPage { Xml::label( wfMsg( 'newtitle' ), 'wpNewTitle' ) . " " . - Xml::input( 'wpNewTitle', 40, $wgContLang->recodeForEdit( $newTitle->getPrefixedText() ), array( 'type' => 'text', 'id' => 'wpNewTitle' ) ) . + Xml::input( 'wpNewTitle', 40, $wgContLang->recodeForEdit( $newTitle->getPrefixedText() ), array( 'type' => 'text', 'id' => 'wpNewTitle', 'maxlength' => 255 ) ) . + // maxLength enforced in JS. Html::hidden( 'wpOldTitle', $this->oldTitle->getPrefixedText() ) . " diff --git a/resources/mediawiki.special/mediawiki.special.movePage.js b/resources/mediawiki.special/mediawiki.special.movePage.js index 2f94cc06c3..be238df2d2 100644 --- a/resources/mediawiki.special/mediawiki.special.movePage.js +++ b/resources/mediawiki.special/mediawiki.special.movePage.js @@ -2,4 +2,5 @@ jQuery( function( $ ) { $( '#wpReason' ).byteLimit(); + $( '#wpNewTitle' ).byteLimit(); });