Localisation updates from https://translatewiki.net.
[lhc/web/wiklou.git] / includes / api / ApiQueryRevisions.php
index 2e980f3..552ca3b 100644 (file)
@@ -53,15 +53,16 @@ class ApiQueryRevisions extends ApiQueryRevisionsBase {
                        return $this->tokenFunctions;
                }
 
-               // If we're in JSON callback mode, no tokens can be obtained
-               if ( !is_null( $this->getMain()->getRequest()->getVal( 'callback' ) ) ) {
+               // If we're in a mode that breaks the same-origin policy, no tokens can
+               // be obtained
+               if ( $this->lacksSameOriginSecurity() ) {
                        return array();
                }
 
                $this->tokenFunctions = array(
                        'rollback' => array( 'ApiQueryRevisions', 'getRollbackToken' )
                );
-               wfRunHooks( 'APIQueryRevisionsTokens', array( &$this->tokenFunctions ) );
+               Hooks::run( 'APIQueryRevisionsTokens', array( &$this->tokenFunctions ) );
 
                return $this->tokenFunctions;
        }
@@ -167,7 +168,7 @@ class ApiQueryRevisions extends ApiQueryRevisionsBase {
                        $this->addWhereFld( 'ct_tag', $params['tag'] );
                }
 
-               if ( $this->fld_content || !is_null( $this->diffto ) || !is_null( $this->difftotext ) ) {
+               if ( $this->fetchContent ) {
                        // For each page we will request, the user must have read rights for that page
                        $user = $this->getUser();
                        /** @var $title Title */