don't load revision text content unless requested to
authorAriel T. Glenn <ariel@wikimedia.org>
Mon, 22 Jul 2019 07:28:51 +0000 (10:28 +0300)
committerAriel T. Glenn <ariel@wikimedia.org>
Mon, 22 Jul 2019 07:50:06 +0000 (10:50 +0300)
Bug: T228614
Change-Id: Idef4d9684560110a16c6a7c074402c5a5a6e59db

includes/export/XmlDumpWriter.php

index 7ee6d85..8535564 100644 (file)
@@ -359,7 +359,10 @@ class XmlDumpWriter {
 
                // Avoid PHP 7.1 warning from passing $this by reference
                $writer = $this;
-               $text = $rev->getContent( SlotRecord::MAIN, RevisionRecord::RAW );
+               $text = '';
+               if ( $contentMode === self::WRITE_CONTENT ) {
+                       $text = $rev->getContent( SlotRecord::MAIN, RevisionRecord::RAW );
+               }
                Hooks::run( 'XmlDumpWriterWriteRevision', [ &$writer, &$out, $row, $text, $rev ] );
 
                $out .= "    </revision>\n";