r82804 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r82803‎ | r82804 | r82805 >
Date:17:29, 25 February 2011
Author:reedy
Status:resolved (Comments)
Tags:
Comment:
* (bug 23819) Special:RenameUser should allow suppression of automatically-created redirect

Drop the post check, seems a bit redundant, and allows the stuff not to work if they're passed as GET parameters
Modified paths:
  • /trunk/extensions/Renameuser/Renameuser.php (modified) (history)
  • /trunk/extensions/Renameuser/Renameuser_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Renameuser/Renameuser.php
@@ -67,6 +67,8 @@
6868 /**
6969 * Show a log if the user has been renamed and point to the new username.
7070 * Don't show the log if the $oldUserName exists as a user.
 71+ *
 72+ * @param $article Article
7173 */
7274 function wfRenameUserShowLog( $article ) {
7375 global $wgOut;
Index: trunk/extensions/Renameuser/Renameuser_body.php
@@ -46,18 +46,10 @@
4747 $nun = is_object( $newusername ) ? $newusername->getText() : '';
4848 $token = $wgUser->editToken();
4949 $reason = $wgRequest->getText( 'reason' );
50 - // If nothing given for these flags, assume they are checked
51 - // unless this is a POST submission.
52 - $move_checked = true;
53 - $suppress_checked = false;
54 - if ( $wgRequest->wasPosted() ) {
55 - if ( !$wgRequest->getCheck( 'movepages' ) ) {
56 - $move_checked = false;
57 - }
58 - if ( $wgRequest->getCheck( 'suppressredirect' ) ) {
59 - $suppress_checked = true;
60 - }
61 - }
 50+
 51+ $move_checked = $wgRequest->getCheck( 'movepages' );
 52+ $suppress_checked = $wgRequest->getCheck( 'suppressredirect' );
 53+
6254 $warnings = array();
6355 if ( $oun && $nun && !$wgRequest->getCheck( 'confirmaction' ) ) {
6456 wfRunHooks( 'RenameUserWarning', array( $oun, $nun, &$warnings ) );

Follow-up revisions

RevisionCommit summaryAuthorDate
r83034bug 23819/followup r82804reedy19:03, 1 March 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r74510=(bug 23819) Add option to suppress redirects when renaming usersoxred9313:01, 8 October 2010

Comments

#Comment by Amalthea (talk | contribs)   21:04, 26 February 2011

https://bugzilla.wikimedia.org/show_bug.cgi?id=23819#c8

Replace

$move_checked = $wgRequest->getCheck( 'movepages' );

by

$move_checked = $wgRequest->getBool( 'movepages', !$wgRequest->wasPosted());

Status & tagging log