Merge "Hide exceptions in MediaWiki::doJobs() as deferred updates do."
[lhc/web/wiklou.git] / includes / diff / DifferenceEngine.php
index c551107..4ee066e 100644 (file)
@@ -410,7 +410,7 @@ class DifferenceEngine extends ContextSource {
         * @return String
         */
        protected function markPatrolledLink() {
-               global $wgUseRCPatrol, $wgRCMaxAge;
+               global $wgUseRCPatrol, $wgRCMaxAge, $wgEnableAPI, $wgEnableWriteAPI;
                $cache = wfGetMainCache();
 
                if ( $this->mMarkPatrolledLink === null ) {
@@ -431,7 +431,6 @@ class DifferenceEngine extends ContextSource {
                                        array(
                                                'rc_timestamp' => $db->timestamp( $this->mNewRev->getTimestamp() ),
                                                'rc_this_oldid' => $this->mNewid,
-                                               'rc_last_oldid' => $this->mOldid,
                                                'rc_patrolled' => 0
                                        ),
                                        __METHOD__,
@@ -447,7 +446,11 @@ class DifferenceEngine extends ContextSource {
                                // Build the link
                                if ( $rcid ) {
                                        $this->getOutput()->preventClickjacking();
-                                       $this->getOutput()->addModules( 'mediawiki.page.patrol.ajax' );
+                                       if ( $wgEnableAPI && $wgEnableWriteAPI
+                                               && $this->getUser()->isAllowed( 'writeapi' )
+                                       ) {
+                                               $this->getOutput()->addModules( 'mediawiki.page.patrol.ajax' );
+                                       }
 
                                        $token = $this->getUser()->getEditToken( $rcid );
                                        $this->mMarkPatrolledLink = ' <span class="patrollink">[' . Linker::linkKnown(