# If we have been passed an &rcid= parameter, we want to give the user a
# chance to mark this new article as patrolled.
- if( !is_null( $rcid ) && $rcid != 0 && $wgUser->isAllowed( 'patrol' ) && $this->mTitle->exists() ) {
+ if( !empty($rcid) && $this->mTitle->exists() && $this->mTitle->userCan('patrol') ) {
$wgOut->addHTML(
"<div class='patrollink'>" .
wfMsgHtml( 'markaspatrolledlink',
}
// Prepare a change patrol link, if applicable
- if( $wgUseRCPatrol && $wgUser->isAllowed( 'patrol' ) ) {
+ if( $wgUseRCPatrol && $this->mTitle->userCan('patrol') ) {
// If we've been given an explicit change identifier, use it; saves time
if( $this->mRcidMarkPatrolled ) {
$rcid = $this->mRcidMarkPatrolled;
array(
// Add redundant user,timestamp condition so we can use the existing index
'rc_user_text' => $this->mNewRev->getUserText( Revision::FOR_THIS_USER ),
- 'rc_timestamp' => $db->timestamp( $this->mNewRev->getTimestamp() ),
+ 'rc_timestamp' => $db->timestamp( $this->mNewRev->getTimestamp() ),
'rc_this_oldid' => $this->mNewid,
'rc_last_oldid' => $this->mOldid,
- 'rc_patrolled' => 0
+ 'rc_patrolled' => 0
),
__METHOD__
);
// Build the link
if( $rcid ) {
$patrol = ' <span class="patrollink">[' . $sk->makeKnownLinkObj(
- $this->mTitle,
- wfMsgHtml( 'markaspatrolleddiff' ),
- "action=markpatrolled&rcid={$rcid}"
- ) . ']</span>';
+ $this->mTitle,
+ wfMsgHtml( 'markaspatrolleddiff' ),
+ "action=markpatrolled&rcid={$rcid}"
+ ) . ']</span>';
} else {
$patrol = '';
}