From ba16bbd0a98530e5665e6fe4765ba25b5a873cf9 Mon Sep 17 00:00:00 2001 From: Alexander Lehmann Date: Tue, 20 May 2014 14:26:33 +0200 Subject: [PATCH] Inserted test whether the resource 'uploadsource' is already registered. Bug: 65530 Change-Id: I1b82d6dc6a37792d4e7b7d01316802ea4d38a88b --- includes/Import.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/includes/Import.php b/includes/Import.php index 743037cd79..4940c19e7a 100644 --- a/includes/Import.php +++ b/includes/Import.php @@ -45,7 +45,9 @@ class WikiImporter { function __construct( $source ) { $this->reader = new XMLReader(); - stream_wrapper_register( 'uploadsource', 'UploadSourceAdapter' ); + if ( !in_array( 'uploadsource', stream_get_wrappers() ) ) { + stream_wrapper_register( 'uploadsource', 'UploadSourceAdapter' ); + } $id = UploadSourceAdapter::registerSource( $source ); if ( defined( 'LIBXML_PARSEHUGE' ) ) { $this->reader->open( "uploadsource://$id", null, LIBXML_PARSEHUGE ); -- 2.20.1