r10023 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r10022‎ | r10023 | r10024 >
Date:08:41, 9 July 2005
Author:timstarling
Status:old
Tags:
Comment:
Fixed security
Modified paths:
  • /trunk/extensions/Renameuser/SpecialRenameuser.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Renameuser/SpecialRenameuser.php
@@ -63,6 +63,8 @@
6464 $renameuserold = wfMsgHtml( 'renameuserold' );
6565 $renameusernew = wfMsgHtml( 'renameusernew' );
6666 $go = wfMsgHtml( 'go' );
 67+ $token = $wgUser->editToken();
 68+
6769 $wgOut->addHTML( "
6870 <form id='renameuser' method='post' action=\"$action\">
6971 <table>
@@ -79,8 +81,12 @@
8082 <td align='right'><input type='submit' name='submit' value=\"$go\" /></td>
8183 </tr>
8284 </table>
 85+ <input type='hidden' name='token' value='$token' />
8386 </form>");
8487 // Sanity checks
 88+ if ( !$wgRequest->wasPosted() || !$wgUser->matchEditToken( $wgRequest->getVal( 'token' ) ) )
 89+ return;
 90+
8591 if ($oldusername == '' || $newusername == '' || $oldusername == $newusername)
8692 return;
8793

Status & tagging log