From cb8dad9da4019a42ef12edf0d9dc10833ba301ab Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Sat, 23 Oct 2010 17:22:38 +0000 Subject: [PATCH] BREAKING CHANGE: Per r70640 CR, salt patrol tokens with rcid in the API too. This means patrol tokens are now different for every recentchanges entry. --- includes/api/ApiPatrol.php | 3 ++- includes/api/ApiQueryRecentChanges.php | 12 +++--------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/includes/api/ApiPatrol.php b/includes/api/ApiPatrol.php index d424dd0b20..ddc205f220 100644 --- a/includes/api/ApiPatrol.php +++ b/includes/api/ApiPatrol.php @@ -95,7 +95,8 @@ class ApiPatrol extends ApiBase { } public function getTokenSalt() { - return ''; + $params = $this->extractRequestParams(); + return $params['rcid']; } protected function getExamples() { diff --git a/includes/api/ApiQueryRecentChanges.php b/includes/api/ApiQueryRecentChanges.php index 32d1bf8b12..2e9f9b7f43 100644 --- a/includes/api/ApiQueryRecentChanges.php +++ b/includes/api/ApiQueryRecentChanges.php @@ -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. */ -- 2.20.1