r74217 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r74216‎ | r74217 | r74218 >
Date:15:53, 3 October 2010
Author:reedy
Status:ok
Tags:
Comment:
MFT r74098, r74099

bug 25248 API: paraminfo errors with certain modules, occurs in 1.16

Not merging ApiRollback, due to Token stuff not being in the 1.16 Rollback (was it because it was borked?)

Wasn't broken in 1.16 test install, so will be fine
Modified paths:
  • /branches/REL1_16/phase3/RELEASE-NOTES (modified) (history)
  • /branches/REL1_16/phase3/includes/api (modified) (history)
  • /branches/REL1_16/phase3/includes/api/ApiBase.php (modified) (history)
  • /branches/REL1_16/phase3/includes/api/ApiBlock.php (modified) (history)
  • /branches/REL1_16/phase3/includes/api/ApiDelete.php (modified) (history)
  • /branches/REL1_16/phase3/includes/api/ApiEditPage.php (modified) (history)
  • /branches/REL1_16/phase3/includes/api/ApiEmailUser.php (modified) (history)
  • /branches/REL1_16/phase3/includes/api/ApiImport.php (modified) (history)
  • /branches/REL1_16/phase3/includes/api/ApiMove.php (modified) (history)
  • /branches/REL1_16/phase3/includes/api/ApiPatrol.php (modified) (history)
  • /branches/REL1_16/phase3/includes/api/ApiProtect.php (modified) (history)
  • /branches/REL1_16/phase3/includes/api/ApiQueryAllUsers.php (modified) (history)
  • /branches/REL1_16/phase3/includes/api/ApiUnblock.php (modified) (history)
  • /branches/REL1_16/phase3/includes/api/ApiUndelete.php (modified) (history)
  • /branches/REL1_16/phase3/includes/api/ApiUpload.php (modified) (history)
  • /branches/REL1_16/phase3/includes/api/ApiUserrights.php (modified) (history)

Diff [purge]

Index: branches/REL1_16/phase3/includes/api/ApiMove.php
@@ -219,6 +219,10 @@
220220 ) );
221221 }
222222
 223+ public function needsToken() {
 224+ return true;
 225+ }
 226+
223227 public function getTokenSalt() {
224228 return '';
225229 }
Index: branches/REL1_16/phase3/includes/api/ApiProtect.php
@@ -184,8 +184,12 @@
185185 ) );
186186 }
187187
 188+ public function needsToken() {
 189+ return true;
 190+ }
 191+
188192 public function getTokenSalt() {
189 - return null;
 193+ return '';
190194 }
191195
192196 protected function getExamples() {
Index: branches/REL1_16/phase3/includes/api/ApiUserrights.php
@@ -101,6 +101,10 @@
102102 array( 'missingparam', 'user' ),
103103 ) );
104104 }
 105+
 106+ public function needsToken() {
 107+ return true;
 108+ }
105109
106110 public function getTokenSalt() {
107111 $params = $this->extractRequestParams();
Index: branches/REL1_16/phase3/includes/api/ApiDelete.php
@@ -230,6 +230,10 @@
231231 ) );
232232 }
233233
 234+ public function needsToken() {
 235+ return true;
 236+ }
 237+
234238 public function getTokenSalt() {
235239 return '';
236240 }
Index: branches/REL1_16/phase3/includes/api/ApiImport.php
@@ -149,6 +149,10 @@
150150 ) );
151151 }
152152
 153+ public function needsToken() {
 154+ return true;
 155+ }
 156+
153157 public function getTokenSalt() {
154158 return '';
155159 }
Index: branches/REL1_16/phase3/includes/api/ApiEditPage.php
@@ -454,6 +454,10 @@
455455 );
456456 }
457457
 458+ public function needsToken() {
 459+ return true;
 460+ }
 461+
458462 public function getTokenSalt() {
459463 return '';
460464 }
Index: branches/REL1_16/phase3/includes/api/ApiUnblock.php
@@ -116,6 +116,10 @@
117117 ) );
118118 }
119119
 120+ public function needsToken() {
 121+ return true;
 122+ }
 123+
120124 public function getTokenSalt() {
121125 return '';
122126 }
Index: branches/REL1_16/phase3/includes/api/ApiEmailUser.php
@@ -112,6 +112,10 @@
113113 ) );
114114 }
115115
 116+ public function needsToken() {
 117+ return true;
 118+ }
 119+
116120 public function getTokenSalt() {
117121 return '';
118122 }
Index: branches/REL1_16/phase3/includes/api/ApiBlock.php
@@ -175,6 +175,10 @@
176176 ) );
177177 }
178178
 179+ public function needsToken() {
 180+ return true;
 181+ }
 182+
179183 public function getTokenSalt() {
180184 return '';
181185 }
Index: branches/REL1_16/phase3/includes/api/ApiPatrol.php
@@ -92,6 +92,10 @@
9393 ) );
9494 }
9595
 96+ public function needsToken() {
 97+ return true;
 98+ }
 99+
96100 public function getTokenSalt() {
97101 return '';
98102 }
Index: branches/REL1_16/phase3/includes/api/ApiUndelete.php
@@ -125,6 +125,10 @@
126126 ) );
127127 }
128128
 129+ public function needsToken() {
 130+ return true;
 131+ }
 132+
129133 public function getTokenSalt() {
130134 return '';
131135 }
Index: branches/REL1_16/phase3/includes/api/ApiBase.php
@@ -1006,6 +1006,14 @@
10071007 }
10081008
10091009 /**
 1010+ * Returns whether this module requires a Token to execute
 1011+ * @returns bool
 1012+ */
 1013+ public function needsToken() {
 1014+ return false;
 1015+ }
 1016+
 1017+ /**
10101018 * Returns the token salt if there is one, '' if the module doesn't require a salt, else false if the module doesn't need a token
10111019 * @returns bool
10121020 */
@@ -1033,7 +1041,7 @@
10341042 $ret[] = array( 'writedisabled' );
10351043 }
10361044
1037 - if ( $this->getTokenSalt() !== false ) {
 1045+ if ( $this->needsToken() ) {
10381046 $ret[] = array( 'missingparam', 'token' );
10391047 $ret[] = array( 'sessionfailure' );
10401048 }
Property changes on: branches/REL1_16/phase3/includes/api/ApiBase.php
___________________________________________________________________
Modified: svn:mergeinfo
10411049 Merged /trunk/phase3/includes/api/ApiBase.php:r74098-74099
Property changes on: branches/REL1_16/phase3/includes/api/ApiQueryAllUsers.php
___________________________________________________________________
Modified: svn:mergeinfo
10421050 Merged /trunk/phase3/includes/api/ApiQueryAllUsers.php:r74098-74099
Index: branches/REL1_16/phase3/includes/api/ApiUpload.php
@@ -306,6 +306,10 @@
307307 ) );
308308 }
309309
 310+ public function needsToken() {
 311+ return true;
 312+ }
 313+
310314 public function getTokenSalt() {
311315 return '';
312316 }
Property changes on: branches/REL1_16/phase3/includes/api
___________________________________________________________________
Modified: svn:mergeinfo
313317 Merged /trunk/phase3/includes/api:r74098-74099
Index: branches/REL1_16/phase3/RELEASE-NOTES
@@ -51,6 +51,7 @@
5252 * For wikis setup in French language, Special:Téléchargement works again
5353 as an alias for Special:Upload
5454 * (bug 25167) Correctly load JS fixes for IE6 (fixing a regression in 1.16.0)
 55+* (bug 25248) API: paraminfo errors with certain modules
5556
5657 == Changes since 1.16 beta 3 ==
5758

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r73596follow up r72387: using ApiQuery here breaks ApiParamInfo (bug 25248)gurch10:46, 23 September 2010
r74098* (bug 25248) API: paraminfo errors with certain modules...reedy20:12, 1 October 2010
r74099Minor followup to r74095, remove method as all it does is call it's parent (T...reedy20:17, 1 October 2010

Status & tagging log