In abstracts for the specific case, we don't care at all, since the
problem is that it's a self redirect. Redirects are filtered out of
the stream at the end so it won't even show up.
In anything else, we do what dumpTextPass does already, which is to
leave the text alone and emit it as is.
Bug: T217329
Change-Id: I39cdf89531c67962b1a9bba4e0a91f7c655ad6f3
} elseif ( isset( $row->old_text ) ) {
// Raw text from the database may have invalid chars
$text = strval( Revision::getRevisionText( $row ) );
- $text = $content_handler->exportTransform( $text, $content_format );
+ try {
+ $text = $content_handler->exportTransform( $text, $content_format );
+ }
+ catch ( MWException $ex ) {
+ // leave text as is; that's the way it goes
+ }
$out .= " " . Xml::elementClean( 'text',
[ 'xml:space' => 'preserve', 'bytes' => intval( $row->rev_len ) ],
strval( $text ) ) . "\n";