API: Don't give patrol tokens for non-new RCs if only NP patrol is enabled
authorRoan Kattouw <catrope@users.mediawiki.org>
Sun, 29 Mar 2009 12:51:39 +0000 (12:51 +0000)
committerRoan Kattouw <catrope@users.mediawiki.org>
Sun, 29 Mar 2009 12:51:39 +0000 (12:51 +0000)
includes/api/ApiQueryRecentChanges.php

index 94b1fee..13e7375 100644 (file)
@@ -68,7 +68,8 @@ class ApiQueryRecentChanges extends ApiQueryBase {
        public static function getPatrolToken($pageid, $title, $rc)
        {
                global $wgUser;
-               if(!$wgUser->useRCPatrol() && !$wgUser->useNPPatrol())
+               if(!$wgUser->useRCPatrol() && (!$wgUser->useNPPatrol() ||
+                                $rc->getAttribute('rc_type') != RC_NEW))
                        return false;
                
                // The patrol token is always the same, let's exploit that