From: Roan Kattouw Date: Sat, 23 Oct 2010 17:22:38 +0000 (+0000) Subject: BREAKING CHANGE: Per r70640 CR, salt patrol tokens with rcid in the API too. This... X-Git-Tag: 1.31.0-rc.0~34353 X-Git-Url: http://git.cyclocoop.org/%22.%24h.%22?a=commitdiff_plain;h=cb8dad9da4019a42ef12edf0d9dc10833ba301ab;p=lhc%2Fweb%2Fwiklou.git 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. --- 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. */