*/
abstract class ApiQueryRevisionsBase extends ApiQueryGeneratorBase {
- protected $limit, $diffto, $difftotext, $expandTemplates, $generateXML, $section,
- $parseContent, $fetchContent, $contentFormat, $setParsedLimit = true;
+ protected $limit, $diffto, $difftotext, $difftotextpst, $expandTemplates, $generateXML,
+ $section, $parseContent, $fetchContent, $contentFormat, $setParsedLimit = true;
protected $fld_ids = false, $fld_flags = false, $fld_timestamp = false,
$fld_size = false, $fld_sha1 = false, $fld_comment = false,
protected function parseParameters( $params ) {
if ( !is_null( $params['difftotext'] ) ) {
$this->difftotext = $params['difftotext'];
+ $this->difftotextpst = $params['difftotextpst'];
} elseif ( !is_null( $params['diffto'] ) ) {
if ( $params['diffto'] == 'cur' ) {
$params['diffto'] = 0;
$this->contentFormat
);
+ if ( $this->difftotextpst ) {
+ $popts = ParserOptions::newFromContext( $this->getContext() );
+ $difftocontent = $difftocontent->preSaveTransform( $title, $user, $popts );
+ }
+
$engine = $handler->createDifferenceEngine( $context );
$engine->setContent( $content, $difftocontent );
}
ApiBase::PARAM_DFLT => null,
ApiBase::PARAM_HELP_MSG => 'apihelp-query+revisions+base-param-difftotext',
),
+ 'difftotextpst' => array(
+ ApiBase::PARAM_DFLT => false,
+ ApiBase::PARAM_HELP_MSG => 'apihelp-query+revisions+base-param-difftotextpst',
+ ),
'contentformat' => array(
ApiBase::PARAM_TYPE => ContentHandler::getAllContentFormats(),
ApiBase::PARAM_DFLT => null,
"apihelp-query+revisions+base-param-section": "Only retrieve the content of this section number.",
"apihelp-query+revisions+base-param-diffto": "Revision ID to diff each revision to. Use <kbd>prev</kbd>, <kbd>next</kbd> and <kbd>cur</kbd> for the previous, next and current revision respectively.",
"apihelp-query+revisions+base-param-difftotext": "Text to diff each revision to. Only diffs a limited number of revisions. Overrides <var>$1diffto</var>. If <var>$1section</var> is set, only that section will be diffed against this text.",
+ "apihelp-query+revisions+base-param-difftotextpst": "Perform a pre-save transform on the text before diffing it. Only valid when used with <var>$1difftotext</var>.",
"apihelp-query+revisions+base-param-contentformat": "Serialization format used for <var>$1difftotext</var> and expected for output of content.",
"apihelp-query+search-description": "Perform a full text search.",
"apihelp-query+revisions+base-param-section": "{{doc-apihelp-param|query+revisions+base|section|description=the \"section\" parameter to revision querying modules|noseealso=1}}",
"apihelp-query+revisions+base-param-diffto": "{{doc-apihelp-param|query+revisions+base|diffto|description=the \"diffto\" parameter to revision querying modules|noseealso=1}}",
"apihelp-query+revisions+base-param-difftotext": "{{doc-apihelp-param|query+revisions+base|difftotext|description=the \"difftotext\" parameter to revision querying modules|noseealso=1}}",
+ "apihelp-query+revisions+base-param-difftotextpst": "{{doc-apihelp-param|query+revisions+base|difftotextpst|description=the \"difftotextpst\" parameter to revision querying modules|noseealso=1}}",
"apihelp-query+revisions+base-param-contentformat": "{{doc-apihelp-param|query+revisions+base|contentformat|description=the \"contentformat\" parameter to revision querying modules|noseealso=1}}",
"apihelp-query+search-description": "{{doc-apihelp-description|query+search}}",
"apihelp-query+search-param-search": "{{doc-apihelp-param|query+search|search}}",