r21608 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r21607‎ | r21608 | r21609 >
Date:09:43, 26 April 2007
Author:raymond
Status:old
Tags:
Comment:
Escaping, thanks to Nikerabbit
Modified paths:
  • /trunk/extensions/Makesysop/SpecialMakesysop_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Makesysop/SpecialMakesysop_body.php
@@ -61,7 +61,7 @@
6262 $this->mAction = $request->getText( 'action' );
6363 $this->mRights = $request->getVal( 'wpRights' );
6464 $this->mUser = $request->getText( 'wpMakesysopUser' );
65 - $this->mReason = htmlspecialchars( $request->getText( 'wpMakesysopReason' ) );
 65+ $this->mReason = $request->getText( 'wpMakesysopReason' );
6666 $this->mSubmit = $request->getBool( 'wpMakesysopSubmit' ) &&
6767 $request->wasPosted() &&
6868 $wgUser->matchEditToken( $request->getVal( 'wpEditToken' ) );
@@ -88,7 +88,7 @@
8989 $encUser = "";
9090 }
9191
92 - $reason = wfMsg( "makesysopreason" );
 92+ $reason = htmlspecialchars( wfMsg( "makesysopreason" ) );
9393 $makebureaucrat = wfMsg( "setbureaucratflag" );
9494 $mss = wfMsg( "set_user_rights" );
9595 $token = htmlspecialchars( $wgUser->editToken() );
@@ -187,7 +187,7 @@
188188 $newGroups = array_merge($newGroups, $addedGroups);
189189
190190 $log = new LogPage( 'rights' );
191 - $log->addEntry( 'rights', Title::makeTitle( NS_USER, $username ), $this->mReason,
 191+ $log->addEntry( 'rights', Title::makeTitle( NS_USER, $username ), htmlspecialchars( $this->mReason ),
192192 array( $this->makeGroupNameList( $oldGroups ), $this->makeGroupNameList( $newGroups ) ) );
193193
194194 $this->showSuccess();
@@ -254,7 +254,6 @@
255255
256256 $oldGroups = $this->getUserGroups( $database, $userid );
257257 $newGroups = $oldGroups;
258 - $logcomment = $this->mReason;
259258 // remove then add groups
260259 if(isset($removegroup)) {
261260 $newGroups = array_diff($newGroups, $removegroup);
@@ -277,7 +276,7 @@
278277 wfDebug( 'newGroups: ' . print_r( $newGroups, true ) );
279278
280279 $log = new LogPage( 'rights' );
281 - $log->addEntry( 'rights', Title::makeTitle( NS_USER, $username ), $logcomment, array( $this->makeGroupNameList( $oldGroups ),
 280+ $log->addEntry( 'rights', Title::makeTitle( NS_USER, $username ), $this->mReason, array( $this->makeGroupNameList( $oldGroups ),
282281 $this->makeGroupNameList( $newGroups ) ) );
283282 }
284283