From: Alexander Lehmann Date: Tue, 20 May 2014 12:26:33 +0000 (+0200) Subject: Inserted test whether the resource 'uploadsource' is already registered. X-Git-Tag: 1.31.0-rc.0~15638^2 X-Git-Url: http://git.cyclocoop.org/data/%24self?a=commitdiff_plain;h=ba16bbd0a98530e5665e6fe4765ba25b5a873cf9;p=lhc%2Fweb%2Fwiklou.git Inserted test whether the resource 'uploadsource' is already registered. Bug: 65530 Change-Id: I1b82d6dc6a37792d4e7b7d01316802ea4d38a88b --- 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 );