From de1f9c7d61e792217305e26392cfe4d3a48b3207 Mon Sep 17 00:00:00 2001 From: Ariel Glenn Date: Tue, 12 Jul 2011 15:01:58 +0000 Subject: [PATCH] libxml >= 2.7.3 ha a 10mb cap on the size of a text node and the LIBXML_PARSEHUGE lets us override that, needed for lucid since there are a few revs in the db larger than that limit --- includes/Import.php | 7 ++++++- maintenance/backupPrefetch.inc | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/includes/Import.php b/includes/Import.php index 2a864382d5..e1fde33c24 100644 --- a/includes/Import.php +++ b/includes/Import.php @@ -45,7 +45,12 @@ class WikiImporter { stream_wrapper_register( 'uploadsource', 'UploadSourceAdapter' ); $id = UploadSourceAdapter::registerSource( $source ); - $this->reader->open( "uploadsource://$id" ); + if (defined( 'LIBXML_PARSEHUGE' ) ) { + $this->reader->open( "uploadsource://$id", null, LIBXML_PARSEHUGE ); + } + else { + $this->reader->open( "uploadsource://$id" ); + } // Default callbacks $this->setRevisionCallback( array( $this, "importRevision" ) ); diff --git a/maintenance/backupPrefetch.inc b/maintenance/backupPrefetch.inc index d3c4e790db..93f75c65d3 100644 --- a/maintenance/backupPrefetch.inc +++ b/maintenance/backupPrefetch.inc @@ -51,7 +51,12 @@ class BaseDump { $this->infiles = explode(';',$infile); $this->reader = new XMLReader(); $infile = array_shift($this->infiles); - $this->reader->open( $infile ); + if (defined( 'LIBXML_PARSEHUGE' ) ) { + $this->reader->open( $infile, null, LIBXML_PARSEHUGE ); + } + else { + $this->reader->open( $infile ); + } } /** -- 2.20.1