X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fimport%2FWikiImporter.php;h=90660797f108f8cf68a2458b196daca0793acb82;hb=f0bef2cf6994c49031d89425b3b3c56fd0e89a65;hp=7c89b23a2097a47103ffeb560dea0a281bff64bb;hpb=a8a5f03b3b6653136c4dc5925d6bb2b806010725;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/import/WikiImporter.php b/includes/import/WikiImporter.php index 7c89b23a20..90660797f1 100644 --- a/includes/import/WikiImporter.php +++ b/includes/import/WikiImporter.php @@ -55,16 +55,12 @@ class WikiImporter { * @param Config $config * @throws Exception */ - function __construct( ImportSource $source, Config $config = null ) { + function __construct( ImportSource $source, Config $config ) { if ( !class_exists( 'XMLReader' ) ) { throw new Exception( 'Import requires PHP to have been compiled with libxml support' ); } $this->reader = new XMLReader(); - if ( !$config ) { - wfDeprecated( __METHOD__ . ' without a Config instance', '1.25' ); - $config = MediaWikiServices::getInstance()->getMainConfig(); - } $this->config = $config; if ( !in_array( 'uploadsource', stream_get_wrappers() ) ) { @@ -817,7 +813,7 @@ class WikiImporter { $this->debug( "Enter revision handler" ); $revisionInfo = []; - $normalFields = [ 'id', 'timestamp', 'comment', 'minor', 'model', 'format', 'text' ]; + $normalFields = [ 'id', 'timestamp', 'comment', 'minor', 'model', 'format', 'text', 'sha1' ]; $skip = false; @@ -920,6 +916,9 @@ class WikiImporter { } else { $revision->setUsername( 'Unknown user' ); } + if ( isset( $revisionInfo['sha1'] ) ) { + $revision->setSha1Base36( $revisionInfo['sha1'] ); + } $revision->setNoUpdates( $this->mNoUpdates ); return $this->revisionCallback( $revision );