Index: trunk/phase3/RELEASE-NOTES-1.19 |
— | — | @@ -124,6 +124,7 @@ |
125 | 125 | * (bug 30513) Redirect tag is now resolved in XML dump file. |
126 | 126 | * sha1 xml tag added to XML dump file. |
127 | 127 | * (bug 33646) Badtitle error page now emits a 400 HTTP status. |
| 128 | +* Special:MovePage now has a dropdown menu for namespaces. |
128 | 129 | |
129 | 130 | === Bug fixes in 1.19 === |
130 | 131 | * $wgUploadNavigationUrl should be used for file redlinks if. |
— | — | @@ -240,6 +241,7 @@ |
241 | 242 | * (bug 33902) Decoding %2B with mw.Uri.decode results in ' ' instead of + |
242 | 243 | * (bug 33762) QueryPage-based special pages no longer misses *-summary message. |
243 | 244 | * Other sizes links are no longer generated for wikis without a 404 thumbnail handler. |
| 245 | +* (bug 29454) Enforce byteLimit for page title input on Special:MovePage |
244 | 246 | |
245 | 247 | === API changes in 1.19 === |
246 | 248 | * Made action=edit less likely to return "unknownerror", by returning the actual error |
Index: trunk/phase3/includes/specials/SpecialMovepage.php |
— | — | @@ -51,12 +51,19 @@ |
52 | 52 | $target = !is_null( $par ) ? $par : $request->getVal( 'target' ); |
53 | 53 | |
54 | 54 | // Yes, the use of getVal() and getText() is wanted, see bug 20365 |
| 55 | + |
55 | 56 | $oldTitleText = $request->getVal( 'wpOldTitle', $target ); |
56 | | - $newTitleText = $request->getText( 'wpNewTitle' ); |
57 | | - |
58 | 57 | $this->oldTitle = Title::newFromText( $oldTitleText ); |
59 | | - $this->newTitle = Title::newFromText( $newTitleText ); |
60 | 58 | |
| 59 | + $newTitleTextMain = $request->getText( 'wpNewTitleMain' ); |
| 60 | + $newTitleTextNs = $request->getInt( 'wpNewTitleNs', $this->oldTitle->getNamespace() ); |
| 61 | + // Backwards compatibility for forms submitting here from other sources |
| 62 | + // which is more common than it should be.. |
| 63 | + $newTitleText_bc = $request->getText( 'wpNewTitle' ); |
| 64 | + $this->newTitle = strlen( $newTitleText_bc ) > 0 |
| 65 | + ? Title::newFromText( $newTitleText_bc ) |
| 66 | + : Title::makeTitleSafe( $newTitleTextNs, $newTitleTextMain ); |
| 67 | + |
61 | 68 | if( is_null( $this->oldTitle ) ) { |
62 | 69 | throw new ErrorPageError( 'notargettitle', 'notargettext' ); |
63 | 70 | } |
— | — | @@ -113,7 +120,7 @@ |
114 | 121 | |
115 | 122 | $newTitle = $this->newTitle; |
116 | 123 | |
117 | | - if( !$newTitle ) { |
| 124 | + if ( !$newTitle ) { |
118 | 125 | # Show the current title as a default |
119 | 126 | # when the form is first opened. |
120 | 127 | $newTitle = $this->oldTitle; |
— | — | @@ -235,6 +242,9 @@ |
236 | 243 | $out->addHTML( "</div>\n" ); |
237 | 244 | } |
238 | 245 | |
| 246 | + // Byte limit (not string length limit) for wpReason and wpNewTitleMain |
| 247 | + // is enforced in the mediawiki.special.movePage module |
| 248 | + |
239 | 249 | $out->addHTML( |
240 | 250 | Xml::openElement( 'form', array( 'method' => 'post', 'action' => $this->getTitle()->getLocalURL( 'action=submit' ), 'id' => 'movepage' ) ) . |
241 | 251 | Xml::openElement( 'fieldset' ) . |
— | — | @@ -250,10 +260,18 @@ |
251 | 261 | </tr> |
252 | 262 | <tr> |
253 | 263 | <td class='mw-label'>" . |
254 | | - Xml::label( wfMsg( 'newtitle' ), 'wpNewTitle' ) . |
| 264 | + Xml::label( wfMsg( 'newtitle' ), 'wpNewTitleMain' ) . |
255 | 265 | "</td> |
256 | 266 | <td class='mw-input'>" . |
257 | | - Xml::input( 'wpNewTitle', 60, $wgContLang->recodeForEdit( $newTitle->getPrefixedText() ), array( 'type' => 'text', 'id' => 'wpNewTitle' ) ) . |
| 267 | + Html::namespaceSelector( |
| 268 | + array( 'selected' => $newTitle->getNamespace() ), |
| 269 | + array( 'name' => 'wpNewTitleNs', 'id' => 'wpNewTitleNs' ) |
| 270 | + ) . |
| 271 | + Xml::input( 'wpNewTitleMain', 60, $wgContLang->recodeForEdit( $newTitle->getBaseText() ), array( |
| 272 | + 'type' => 'text', |
| 273 | + 'id' => 'wpNewTitleMain', |
| 274 | + 'maxlength' => 255, |
| 275 | + ) ) . |
258 | 276 | Html::hidden( 'wpOldTitle', $this->oldTitle->getPrefixedText() ) . |
259 | 277 | "</td> |
260 | 278 | </tr> |
— | — | @@ -263,7 +281,7 @@ |
264 | 282 | "</td> |
265 | 283 | <td class='mw-input'>" . |
266 | 284 | Html::element( 'textarea', array( 'name' => 'wpReason', 'id' => 'wpReason', 'cols' => 60, 'rows' => 2, |
267 | | - 'maxlength' => 200 ), $this->reason ) . // maxlength byte limit is enforce in mediawiki.special.movePage.js |
| 285 | + 'maxlength' => 200 ), $this->reason ) . |
268 | 286 | "</td> |
269 | 287 | </tr>" |
270 | 288 | ); |
Index: trunk/phase3/resources/mediawiki.special/mediawiki.special.movePage.js |
— | — | @@ -1,5 +1,5 @@ |
2 | 2 | /* JavaScript for Special:MovePage */ |
3 | 3 | |
4 | 4 | jQuery( function( $ ) { |
5 | | - $( '#wpReason' ).byteLimit(); |
| 5 | + $( '#wpReason, #wpNewTitleMain' ).byteLimit(); |
6 | 6 | }); |