From 280f07725e43b85033eba73d166ae80d717620db Mon Sep 17 00:00:00 2001 From: georggi Date: Sat, 16 Jan 2016 12:32:12 +0200 Subject: [PATCH] Hooks: Added ImportLogInterwikiLink hook ImportLogInterwikiLink. Hook to change the interwiki link used in log entries and edit summaries for transwiki imports. Change-Id: I03e054de16d8820c0f3d2c165288e229960d6bb1 --- docs/hooks.txt | 5 +++++ includes/specials/SpecialImport.php | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/docs/hooks.txt b/docs/hooks.txt index 5e50cec333..2b5e1e0d7e 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -1646,6 +1646,11 @@ Return false to stop further processing of the tag $reader: XMLReader object $revisionInfo: Array of information +'ImportLogInterwikiLink': Hook to change the interwiki link used in log entries +and edit summaries for transwiki imports. +&$fullInterwikiPrefix: Interwiki prefix, may contain colons. +&$pageTitle: String that contains page title. + 'ImportSources': Called when reading from the $wgImportSources configuration variable. Can be used to lazy-load the import sources list. &$importSources: The value of $wgImportSources. Modify as necessary. See the diff --git a/includes/specials/SpecialImport.php b/includes/specials/SpecialImport.php index 97e093b8bd..0574dbc115 100644 --- a/includes/specials/SpecialImport.php +++ b/includes/specials/SpecialImport.php @@ -606,7 +606,11 @@ class ImportReporter extends ContextSource { $successCount )->inContentLanguage()->text(); $action = 'upload'; } else { - $interwikiTitleStr = $this->mInterwiki . ':' . $foreignTitle->getFullText(); + $pageTitle = $foreignTitle->getFullText(); + $fullInterwikiPrefix = $this->mInterwiki; + Hooks::run( 'ImportLogInterwikiLink', array( &$fullInterwikiPrefix, &$pageTitle ) ); + + $interwikiTitleStr = $fullInterwikiPrefix . ':' . $pageTitle; $interwiki = '[[:' . $interwikiTitleStr . ']]'; $detail = $this->msg( 'import-logentry-interwiki-detail' )->numParams( $successCount )->params( $interwiki )->inContentLanguage()->text(); -- 2.20.1