BREAKING CHANGE: Per r70640 CR, salt patrol tokens with rcid in the API too. This...
authorRoan Kattouw <catrope@users.mediawiki.org>
Sat, 23 Oct 2010 17:22:38 +0000 (17:22 +0000)
committerRoan Kattouw <catrope@users.mediawiki.org>
Sat, 23 Oct 2010 17:22:38 +0000 (17:22 +0000)
includes/api/ApiPatrol.php
includes/api/ApiQueryRecentChanges.php

index d424dd0..ddc205f 100644 (file)
@@ -95,7 +95,8 @@ class ApiPatrol extends ApiBase {
        }
 
        public function getTokenSalt() {
-               return '';
+               $params = $this->extractRequestParams();
+               return $params['rcid'];
        }
 
        protected function getExamples() {
index 32d1bf8..2e9f9b7 100644 (file)
@@ -79,14 +79,7 @@ class ApiQueryRecentChanges extends ApiQueryBase {
                        return false;
                }
 
-               // The patrol token is always the same, let's exploit that
-               static $cachedPatrolToken = null;
-               if ( !is_null( $cachedPatrolToken ) ) {
-                       return $cachedPatrolToken;
-               }
-
-               $cachedPatrolToken = $wgUser->editToken();
-               return $cachedPatrolToken;
+               return $wgUser->editToken( $rc->getAttribute( 'rc_id' ) );
        }
 
        /**
@@ -192,7 +185,8 @@ class ApiQueryRecentChanges extends ApiQueryBase {
                        'rc_cur_id',
                        'rc_type',
                        'rc_moved_to_ns',
-                       'rc_moved_to_title'
+                       'rc_moved_to_title',
+                       'rc_deleted'
                ) );
 
                /* Determine what properties we need to display. */