r91355 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r91354‎ | r91355 | r91356 >
Date:15:10, 2 July 2011
Author:ialex
Status:ok
Tags:
Comment:
The User object parameter of WikiPage::doRollback() and WikiPage::commitRollback() was not passed by the Article implementation because it was not present.
While I'm a it, WikiPage::doRollback() and WikiPage::commitRollback() now require that parameter, moved the check to Article.
Modified paths:
  • /trunk/phase3/includes/Article.php (modified) (history)
  • /trunk/phase3/includes/WikiPage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Article.php
@@ -2068,12 +2068,16 @@
20692069 return $this->mPage->doDeleteArticle( $reason, $suppress, $id, $commit, $error );
20702070 }
20712071
2072 - public function doRollback( $fromP, $summary, $token, $bot, &$resultDetails ) {
2073 - return $this->mPage->doRollback( $fromP, $summary, $token, $bot, $resultDetails );
 2072+ public function doRollback( $fromP, $summary, $token, $bot, &$resultDetails, User $user = null ) {
 2073+ global $wgUser;
 2074+ $user = is_null( $user ) ? $wgUser : $user;
 2075+ return $this->mPage->doRollback( $fromP, $summary, $token, $bot, $resultDetails, $user );
20742076 }
20752077
2076 - public function commitRollback( $fromP, $summary, $bot, &$resultDetails ) {
2077 - return $this->mPage->commitRollback( $fromP, $summary, $bot, $resultDetails );
 2078+ public function commitRollback( $fromP, $summary, $bot, &$resultDetails, User $guser = null ) {
 2079+ global $wgUser;
 2080+ $guser = is_null( $guser ) ? $wgUser : $guser;
 2081+ return $this->mPage->commitRollback( $fromP, $summary, $bot, $resultDetails, $guser );
20782082 }
20792083
20802084 // ****** B/C functions for static methods ( __callStatic is PHP>=5.3 ) ****** //
Index: trunk/phase3/includes/WikiPage.php
@@ -1694,11 +1694,8 @@
16951695 * OutputPage::showPermissionsErrorPage().
16961696 */
16971697 public function doRollback(
1698 - $fromP, $summary, $token, $bot, &$resultDetails, User $user = null
 1698+ $fromP, $summary, $token, $bot, &$resultDetails, User $user
16991699 ) {
1700 - global $wgUser;
1701 - $user = is_null( $user ) ? $wgUser : $user;
1702 -
17031700 $resultDetails = null;
17041701
17051702 # Check permissions
@@ -1737,9 +1734,8 @@
17381735 * @param $resultDetails Array: contains result-specific array of additional values
17391736 * @param $guser User The user performing the rollback
17401737 */
1741 - public function commitRollback( $fromP, $summary, $bot, &$resultDetails, User $guser = null ) {
1742 - global $wgUseRCPatrol, $wgUser, $wgContLang;
1743 - $guser = is_null( $guser ) ? $wgUser : $guser;
 1738+ public function commitRollback( $fromP, $summary, $bot, &$resultDetails, User $guser ) {
 1739+ global $wgUseRCPatrol, $wgContLang;
17441740
17451741 $dbw = wfGetDB( DB_MASTER );
17461742

Status & tagging log