r44705 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r44704‎ | r44705 | r44706 >
Date:07:17, 17 December 2008
Author:aaron
Status:ok
Tags:
Comment:
Use more thorough Title->userCan('patrol')
Modified paths:
  • /trunk/phase3/includes/Article.php (modified) (history)
  • /trunk/phase3/includes/diff/DifferenceEngine.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/diff/DifferenceEngine.php
@@ -166,7 +166,7 @@
167167 }
168168
169169 // Prepare a change patrol link, if applicable
170 - if( $wgUseRCPatrol && $wgUser->isAllowed( 'patrol' ) ) {
 170+ if( $wgUseRCPatrol && $this->mTitle->userCan('patrol') ) {
171171 // If we've been given an explicit change identifier, use it; saves time
172172 if( $this->mRcidMarkPatrolled ) {
173173 $rcid = $this->mRcidMarkPatrolled;
@@ -177,10 +177,10 @@
178178 array(
179179 // Add redundant user,timestamp condition so we can use the existing index
180180 'rc_user_text' => $this->mNewRev->getUserText( Revision::FOR_THIS_USER ),
181 - 'rc_timestamp' => $db->timestamp( $this->mNewRev->getTimestamp() ),
 181+ 'rc_timestamp' => $db->timestamp( $this->mNewRev->getTimestamp() ),
182182 'rc_this_oldid' => $this->mNewid,
183183 'rc_last_oldid' => $this->mOldid,
184 - 'rc_patrolled' => 0
 184+ 'rc_patrolled' => 0
185185 ),
186186 __METHOD__
187187 );
@@ -194,10 +194,10 @@
195195 // Build the link
196196 if( $rcid ) {
197197 $patrol = ' <span class="patrollink">[' . $sk->makeKnownLinkObj(
198 - $this->mTitle,
199 - wfMsgHtml( 'markaspatrolleddiff' ),
200 - "action=markpatrolled&rcid={$rcid}"
201 - ) . ']</span>';
 198+ $this->mTitle,
 199+ wfMsgHtml( 'markaspatrolleddiff' ),
 200+ "action=markpatrolled&rcid={$rcid}"
 201+ ) . ']</span>';
202202 } else {
203203 $patrol = '';
204204 }
Index: trunk/phase3/includes/Article.php
@@ -914,7 +914,7 @@
915915
916916 # If we have been passed an &rcid= parameter, we want to give the user a
917917 # chance to mark this new article as patrolled.
918 - if( !is_null( $rcid ) && $rcid != 0 && $wgUser->isAllowed( 'patrol' ) && $this->mTitle->exists() ) {
 918+ if( !empty($rcid) && $this->mTitle->exists() && $this->mTitle->userCan('patrol') ) {
919919 $wgOut->addHTML(
920920 "<div class='patrollink'>" .
921921 wfMsgHtml( 'markaspatrolledlink',

Follow-up revisions

RevisionCommit summaryAuthorDate
r44738*Did a good amount of patrol refactoring. Use core 'patrol' right per r44705 ...aaron22:57, 17 December 2008

Status & tagging log