Merge "Tweaked TempFSFile::bind() param type docs"
[lhc/web/wiklou.git] / includes / api / ApiQueryTokens.php
index 2e107ac..f887664 100644 (file)
@@ -35,10 +35,12 @@ class ApiQueryTokens extends ApiQueryBase {
 
        public function execute() {
                $params = $this->extractRequestParams();
-               $res = array();
+               $res = array(
+                       ApiResult::META_TYPE => 'assoc',
+               );
 
-               if ( $this->getMain()->getRequest()->getVal( 'callback' ) !== null ) {
-                       $this->setWarning( 'Tokens may not be obtained when using a callback' );
+               if ( $this->lacksSameOriginSecurity() ) {
+                       $this->setWarning( 'Tokens may not be obtained when the same-origin policy is not applied' );
                        return;
                }
 
@@ -91,4 +93,8 @@ class ApiQueryTokens extends ApiQueryBase {
        public function getCacheMode( $params ) {
                return 'private';
        }
+
+       public function getHelpUrls() {
+               return 'https://www.mediawiki.org/wiki/API:Tokens';
+       }
 }