summaryrefslogtreecommitdiff
path: root/maintenance/compareParsers.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2013-08-12 09:28:15 +0200
committerPierre Schmitz <pierre@archlinux.de>2013-08-12 09:28:15 +0200
commit08aa4418c30cfc18ccc69a0f0f9cb9e17be6c196 (patch)
tree577a29fb579188d16003a209ce2a2e9c5b0aa2bd /maintenance/compareParsers.php
parentcacc939b34e315b85e2d72997811eb6677996cc1 (diff)
Update to MediaWiki 1.21.1
Diffstat (limited to 'maintenance/compareParsers.php')
-rw-r--r--maintenance/compareParsers.php15
1 files changed, 12 insertions, 3 deletions
diff --git a/maintenance/compareParsers.php b/maintenance/compareParsers.php
index a3337173..1f3ac1c3 100644
--- a/maintenance/compareParsers.php
+++ b/maintenance/compareParsers.php
@@ -114,15 +114,24 @@ class CompareParsers extends DumpIterator {
$parser1 = new $parser1Name();
$parser2 = new $parser2Name();
- $output1 = $parser1->parse( $rev->getText(), $title, $this->options );
- $output2 = $parser2->parse( $rev->getText(), $title, $this->options );
+ $content = $rev->getContent();
+
+ if ( $content->getModel() !== CONTENT_MODEL_WIKITEXT ) {
+ $this->error( "Page {$title->getPrefixedText()} does not contain wikitext but {$content->getModel()}\n" );
+ return;
+ }
+
+ $text = strval( $content->getNativeData() );
+
+ $output1 = $parser1->parse( $text, $title, $this->options );
+ $output2 = $parser2->parse( $text, $title, $this->options );
if ( $output1->getText() != $output2->getText() ) {
$this->failed++;
$this->error( "Parsing for {$title->getPrefixedText()} differs\n" );
if ( $this->saveFailed ) {
- file_put_contents( $this->saveFailed . '/' . rawurlencode( $title->getPrefixedText() ) . ".txt", $rev->getText());
+ file_put_contents( $this->saveFailed . '/' . rawurlencode( $title->getPrefixedText() ) . ".txt", $text );
}
if ( $this->showDiff ) {
$this->output( wfDiff( $this->stripParameters( $output1->getText() ), $this->stripParameters( $output2->getText() ), '' ) );