r41911 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r41910‎ | r41911 | r41912 >
Date:01:02, 10 October 2008
Author:tstarling
Status:old
Tags:
Comment:
Fix error display on invalid destination title on GET, e.g. with URL /wiki/Special:MovePage/Main_Page?wpNewTitle=Main_Page . Broken by r35990 and again by r41343.
Modified paths:
  • /trunk/phase3/includes/specials/SpecialMovepage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialMovepage.php
@@ -97,21 +97,17 @@
9898 # when the form is first opened.
9999 $newTitle = $this->oldTitle;
100100 }
101 - // WTF is this doing, passing title *object* to newFromUrl()??
102 - /*else {
 101+ else {
103102 if( empty($err) ) {
104 - $nt = Title::newFromURL( $this->newTitle );
105 - if( $nt ) {
106 - # If a title was supplied, probably from the move log revert
107 - # link, check for validity. We can then show some diagnostic
108 - # information and save a click.
109 - $newerr = $this->oldTitle->isValidMoveOperation( $nt );
110 - if( is_string( $newerr ) ) {
111 - $err = $newerr;
112 - }
 103+ # If a title was supplied, probably from the move log revert
 104+ # link, check for validity. We can then show some diagnostic
 105+ # information and save a click.
 106+ $newerr = $this->oldTitle->isValidMoveOperation( $newTitle );
 107+ if( $newerr ) {
 108+ $err = $newerr[0];
113109 }
114110 }
115 - }*/
 111+ }
116112
117113 if ( !empty($err) && $err[0] == 'articleexists' && $wgUser->isAllowed( 'delete' ) ) {
118114 $wgOut->addWikiMsg( 'delete_and_move_text', $newTitle->getPrefixedText() );

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r35990Standardization of permission errors and other errors in Special:Movepage, to...rotem12:39, 7 June 2008
r41343* Do not pass objects to functions that don't take themnikerabbit11:51, 28 September 2008

Status & tagging log