$this->addWhereFld( 'ct_tag', $params['tag'] );
}
- if ( $this->fld_content || !is_null( $this->diffto ) || !is_null( $this->difftotext ) ) {
+ if ( $this->fetchContent ) {
// Modern MediaWiki has the content for deleted revs in the 'text'
// table using fields old_text and old_flags. But revisions deleted
// pre-1.5 store the content in the 'archive' table directly using
$this->addWhereFld( 'ct_tag', $params['tag'] );
}
- if ( $this->fld_content || !is_null( $this->diffto ) || !is_null( $this->difftotext ) ) {
+ if ( $this->fetchContent ) {
// Modern MediaWiki has the content for deleted revs in the 'text'
// table using fields old_text and old_flags. But revisions deleted
// pre-1.5 store the content in the 'archive' table directly using
$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 */
abstract class ApiQueryRevisionsBase extends ApiQueryGeneratorBase {
protected $limit, $diffto, $difftotext, $expandTemplates, $generateXML, $section,
- $parseContent, $contentFormat, $setParsedLimit = true;
+ $parseContent, $fetchContent, $contentFormat, $setParsedLimit = true;
protected $fld_ids = false, $fld_flags = false, $fld_timestamp = false,
$fld_size = false, $fld_sha1 = false, $fld_comment = false,
$this->limit = $params['limit'];
+ $this->fetchContent = $this->fld_content || !is_null( $this->diffto )
+ || !is_null( $this->difftotext );
+
$smallLimit = false;
- if ( $this->fld_content || !is_null( $this->diffto ) || !is_null( $this->difftotext ) ) {
+ if ( $this->fetchContent ) {
$smallLimit = true;
$this->expandTemplates = $params['expandtemplates'];
$this->generateXML = $params['generatexml'];
$content = null;
global $wgParser;
- if ( $this->fld_content || !is_null( $this->diffto ) || !is_null( $this->difftotext ) ) {
+ if ( $this->fetchContent ) {
$content = $revision->getContent( Revision::FOR_THIS_USER, $this->getUser() );
// Expand templates after getting section content because
// template-added sections don't count and Parser::preprocess()