summaryrefslogtreecommitdiff
path: root/includes/api
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2011-01-04 12:24:29 +0100
committerPierre Schmitz <pierre@archlinux.de>2011-01-04 12:24:29 +0100
commit8f93926e1bc6e96fc11b4d0d201025022d471de7 (patch)
tree7e13841de0a7d33faf5481d44ca7471ce639193a /includes/api
parentfe786bf329367b2d2663ea7f2474ceaeeace6180 (diff)
update to MediaWiki 1.16.1
Diffstat (limited to 'includes/api')
-rw-r--r--includes/api/ApiBase.php12
-rw-r--r--includes/api/ApiBlock.php6
-rw-r--r--includes/api/ApiDelete.php6
-rw-r--r--includes/api/ApiEditPage.php6
-rw-r--r--includes/api/ApiEmailUser.php6
-rw-r--r--includes/api/ApiImport.php6
-rw-r--r--includes/api/ApiMove.php6
-rw-r--r--includes/api/ApiPatrol.php6
-rw-r--r--includes/api/ApiProtect.php8
-rw-r--r--includes/api/ApiQueryAllUsers.php11
-rw-r--r--includes/api/ApiQueryRevisions.php7
-rw-r--r--includes/api/ApiUnblock.php6
-rw-r--r--includes/api/ApiUndelete.php6
-rw-r--r--includes/api/ApiUpload.php4
-rw-r--r--includes/api/ApiUserrights.php6
15 files changed, 84 insertions, 18 deletions
diff --git a/includes/api/ApiBase.php b/includes/api/ApiBase.php
index b703ab4f..708a3a40 100644
--- a/includes/api/ApiBase.php
+++ b/includes/api/ApiBase.php
@@ -1006,6 +1006,14 @@ abstract class ApiBase {
}
/**
+ * Returns whether this module requires a Token to execute
+ * @returns bool
+ */
+ public function needsToken() {
+ return false;
+ }
+
+ /**
* 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
* @returns bool
*/
@@ -1033,7 +1041,7 @@ abstract class ApiBase {
$ret[] = array( 'writedisabled' );
}
- if ( $this->getTokenSalt() !== false ) {
+ if ( $this->needsToken() ) {
$ret[] = array( 'missingparam', 'token' );
$ret[] = array( 'sessionfailure' );
}
@@ -1184,6 +1192,6 @@ abstract class ApiBase {
* @return string
*/
public static function getBaseVersion() {
- return __CLASS__ . ': $Id: ApiBase.php 70066 2010-07-28 05:52:32Z tstarling $';
+ return __CLASS__ . ': $Id: ApiBase.php 79562 2011-01-04 06:15:54Z tstarling $';
}
}
diff --git a/includes/api/ApiBlock.php b/includes/api/ApiBlock.php
index 91bbaf6d..23de07d6 100644
--- a/includes/api/ApiBlock.php
+++ b/includes/api/ApiBlock.php
@@ -175,6 +175,10 @@ class ApiBlock extends ApiBase {
) );
}
+ public function needsToken() {
+ return true;
+ }
+
public function getTokenSalt() {
return '';
}
@@ -187,6 +191,6 @@ class ApiBlock extends ApiBase {
}
public function getVersion() {
- return __CLASS__ . ': $Id: ApiBlock.php 62766 2010-02-21 12:32:46Z ashley $';
+ return __CLASS__ . ': $Id: ApiBlock.php 74217 2010-10-03 15:53:07Z reedy $';
}
}
diff --git a/includes/api/ApiDelete.php b/includes/api/ApiDelete.php
index 2b349bd7..c4550a96 100644
--- a/includes/api/ApiDelete.php
+++ b/includes/api/ApiDelete.php
@@ -230,6 +230,10 @@ class ApiDelete extends ApiBase {
) );
}
+ public function needsToken() {
+ return true;
+ }
+
public function getTokenSalt() {
return '';
}
@@ -242,6 +246,6 @@ class ApiDelete extends ApiBase {
}
public function getVersion() {
- return __CLASS__ . ': $Id: ApiDelete.php 62703 2010-02-19 12:54:09Z ashley $';
+ return __CLASS__ . ': $Id: ApiDelete.php 74217 2010-10-03 15:53:07Z reedy $';
}
} \ No newline at end of file
diff --git a/includes/api/ApiEditPage.php b/includes/api/ApiEditPage.php
index 50a9836a..e78f66bc 100644
--- a/includes/api/ApiEditPage.php
+++ b/includes/api/ApiEditPage.php
@@ -454,6 +454,10 @@ class ApiEditPage extends ApiBase {
);
}
+ public function needsToken() {
+ return true;
+ }
+
public function getTokenSalt() {
return '';
}
@@ -470,6 +474,6 @@ class ApiEditPage extends ApiBase {
}
public function getVersion() {
- return __CLASS__ . ': $Id: ApiEditPage.php 62600 2010-02-16 22:01:38Z reedy $';
+ return __CLASS__ . ': $Id: ApiEditPage.php 74217 2010-10-03 15:53:07Z reedy $';
}
}
diff --git a/includes/api/ApiEmailUser.php b/includes/api/ApiEmailUser.php
index 912480ef..66f2dff5 100644
--- a/includes/api/ApiEmailUser.php
+++ b/includes/api/ApiEmailUser.php
@@ -112,6 +112,10 @@ class ApiEmailUser extends ApiBase {
) );
}
+ public function needsToken() {
+ return true;
+ }
+
public function getTokenSalt() {
return '';
}
@@ -123,7 +127,7 @@ class ApiEmailUser extends ApiBase {
}
public function getVersion() {
- return __CLASS__ . ': $Id: ApiEmailUser.php 62599 2010-02-16 21:59:16Z reedy $';
+ return __CLASS__ . ': $Id: ApiEmailUser.php 74217 2010-10-03 15:53:07Z reedy $';
}
}
\ No newline at end of file
diff --git a/includes/api/ApiImport.php b/includes/api/ApiImport.php
index 032b684c..d33a472a 100644
--- a/includes/api/ApiImport.php
+++ b/includes/api/ApiImport.php
@@ -149,6 +149,10 @@ class ApiImport extends ApiBase {
) );
}
+ public function needsToken() {
+ return true;
+ }
+
public function getTokenSalt() {
return '';
}
@@ -161,7 +165,7 @@ class ApiImport extends ApiBase {
}
public function getVersion() {
- return __CLASS__ . ': $Id: ApiImport.php 62599 2010-02-16 21:59:16Z reedy $';
+ return __CLASS__ . ': $Id: ApiImport.php 74217 2010-10-03 15:53:07Z reedy $';
}
}
diff --git a/includes/api/ApiMove.php b/includes/api/ApiMove.php
index 71010de7..c234f084 100644
--- a/includes/api/ApiMove.php
+++ b/includes/api/ApiMove.php
@@ -219,6 +219,10 @@ class ApiMove extends ApiBase {
) );
}
+ public function needsToken() {
+ return true;
+ }
+
public function getTokenSalt() {
return '';
}
@@ -230,6 +234,6 @@ class ApiMove extends ApiBase {
}
public function getVersion() {
- return __CLASS__ . ': $Id: ApiMove.php 62810 2010-02-22 03:34:56Z mah $';
+ return __CLASS__ . ': $Id: ApiMove.php 74217 2010-10-03 15:53:07Z reedy $';
}
}
diff --git a/includes/api/ApiPatrol.php b/includes/api/ApiPatrol.php
index 3b2b2046..79916117 100644
--- a/includes/api/ApiPatrol.php
+++ b/includes/api/ApiPatrol.php
@@ -92,6 +92,10 @@ class ApiPatrol extends ApiBase {
) );
}
+ public function needsToken() {
+ return true;
+ }
+
public function getTokenSalt() {
return '';
}
@@ -103,6 +107,6 @@ class ApiPatrol extends ApiBase {
}
public function getVersion() {
- return __CLASS__ . ': $Id: ApiPatrol.php 69578 2010-07-20 02:46:20Z tstarling $';
+ return __CLASS__ . ': $Id: ApiPatrol.php 74217 2010-10-03 15:53:07Z reedy $';
}
} \ No newline at end of file
diff --git a/includes/api/ApiProtect.php b/includes/api/ApiProtect.php
index ca47c1b8..0b1ae4c8 100644
--- a/includes/api/ApiProtect.php
+++ b/includes/api/ApiProtect.php
@@ -184,8 +184,12 @@ class ApiProtect extends ApiBase {
) );
}
+ public function needsToken() {
+ return true;
+ }
+
public function getTokenSalt() {
- return null;
+ return '';
}
protected function getExamples() {
@@ -196,6 +200,6 @@ class ApiProtect extends ApiBase {
}
public function getVersion() {
- return __CLASS__ . ': $Id: ApiProtect.php 62557 2010-02-15 23:53:43Z reedy $';
+ return __CLASS__ . ': $Id: ApiProtect.php 74217 2010-10-03 15:53:07Z reedy $';
}
}
diff --git a/includes/api/ApiQueryAllUsers.php b/includes/api/ApiQueryAllUsers.php
index f8d475cc..611fc98c 100644
--- a/includes/api/ApiQueryAllUsers.php
+++ b/includes/api/ApiQueryAllUsers.php
@@ -184,7 +184,14 @@ class ApiQueryAllUsers extends ApiQueryBase {
}
}
- $db->freeResult( $res );
+ if ( is_array( $lastUserData ) ) {
+ $fit = $result->addValue( array( 'query', $this->getModuleName() ),
+ null, $lastUserData );
+ if ( !$fit ) {
+ $this->setContinueEnumParameter( 'from',
+ $this->keyToTitle( $lastUserData['name'] ) );
+ }
+ }
$result->setIndexedTagName_internal( array( 'query', $this->getModuleName() ), 'u' );
}
@@ -244,6 +251,6 @@ class ApiQueryAllUsers extends ApiQueryBase {
}
public function getVersion() {
- return __CLASS__ . ': $Id: ApiQueryAllUsers.php 69932 2010-07-26 08:03:21Z tstarling $';
+ return __CLASS__ . ': $Id: ApiQueryAllUsers.php 79562 2011-01-04 06:15:54Z tstarling $';
}
}
diff --git a/includes/api/ApiQueryRevisions.php b/includes/api/ApiQueryRevisions.php
index 6166b6a2..3992d6a9 100644
--- a/includes/api/ApiQueryRevisions.php
+++ b/includes/api/ApiQueryRevisions.php
@@ -125,7 +125,7 @@ class ApiQueryRevisions extends ApiQueryBase {
}
$db = $this->getDB();
- $this->addTables( array( 'page', 'revision' ) );
+ $this->addTables( 'page' );
$this->addFields( Revision::selectFields() );
$this->addWhere( 'page_id = rev_page' );
@@ -189,6 +189,9 @@ class ApiQueryRevisions extends ApiQueryBase {
$this->section = false;
}
+ //Bug 24166 - API error when using rvprop=tags
+ $this->addTables( 'revision' );
+
$userMax = ( $this->fld_content ? ApiBase::LIMIT_SML1 : ApiBase::LIMIT_BIG1 );
$botMax = ( $this->fld_content ? ApiBase::LIMIT_SML2 : ApiBase::LIMIT_BIG2 );
$limit = $params['limit'];
@@ -603,6 +606,6 @@ class ApiQueryRevisions extends ApiQueryBase {
}
public function getVersion() {
- return __CLASS__ . ': $Id: ApiQueryRevisions.php 69932 2010-07-26 08:03:21Z tstarling $';
+ return __CLASS__ . ': $Id: ApiQueryRevisions.php 72117 2010-09-01 16:50:07Z reedy $';
}
}
diff --git a/includes/api/ApiUnblock.php b/includes/api/ApiUnblock.php
index 2ffae504..1c4a4ade 100644
--- a/includes/api/ApiUnblock.php
+++ b/includes/api/ApiUnblock.php
@@ -116,6 +116,10 @@ class ApiUnblock extends ApiBase {
) );
}
+ public function needsToken() {
+ return true;
+ }
+
public function getTokenSalt() {
return '';
}
@@ -128,6 +132,6 @@ class ApiUnblock extends ApiBase {
}
public function getVersion() {
- return __CLASS__ . ': $Id: ApiUnblock.php 62599 2010-02-16 21:59:16Z reedy $';
+ return __CLASS__ . ': $Id: ApiUnblock.php 74217 2010-10-03 15:53:07Z reedy $';
}
}
diff --git a/includes/api/ApiUndelete.php b/includes/api/ApiUndelete.php
index 9efba5f3..ae705b69 100644
--- a/includes/api/ApiUndelete.php
+++ b/includes/api/ApiUndelete.php
@@ -125,6 +125,10 @@ class ApiUndelete extends ApiBase {
) );
}
+ public function needsToken() {
+ return true;
+ }
+
public function getTokenSalt() {
return '';
}
@@ -137,6 +141,6 @@ class ApiUndelete extends ApiBase {
}
public function getVersion() {
- return __CLASS__ . ': $Id: ApiUndelete.php 62599 2010-02-16 21:59:16Z reedy $';
+ return __CLASS__ . ': $Id: ApiUndelete.php 74217 2010-10-03 15:53:07Z reedy $';
}
}
diff --git a/includes/api/ApiUpload.php b/includes/api/ApiUpload.php
index 6b91b223..06688997 100644
--- a/includes/api/ApiUpload.php
+++ b/includes/api/ApiUpload.php
@@ -306,6 +306,10 @@ class ApiUpload extends ApiBase {
) );
}
+ public function needsToken() {
+ return true;
+ }
+
public function getTokenSalt() {
return '';
}
diff --git a/includes/api/ApiUserrights.php b/includes/api/ApiUserrights.php
index 6296a8f8..be0750d6 100644
--- a/includes/api/ApiUserrights.php
+++ b/includes/api/ApiUserrights.php
@@ -101,6 +101,10 @@ class ApiUserrights extends ApiBase {
array( 'missingparam', 'user' ),
) );
}
+
+ public function needsToken() {
+ return true;
+ }
public function getTokenSalt() {
$params = $this->extractRequestParams();
@@ -123,6 +127,6 @@ class ApiUserrights extends ApiBase {
}
public function getVersion() {
- return __CLASS__ . ': $Id: ApiUserrights.php 62686 2010-02-19 01:25:57Z reedy $';
+ return __CLASS__ . ': $Id: ApiUserrights.php 74217 2010-10-03 15:53:07Z reedy $';
}
}