From 6ffe70604441f3bdbaeaecce53ee2ae54b40c0fb Mon Sep 17 00:00:00 2001 From: umherirrender Date: Sat, 7 Apr 2012 14:40:01 +0200 Subject: [PATCH] (bug 33564) transwiki import sometimes result in invalid title This is a simple fix. A other solution is to check isExternal on the original title, but than it is never possible to import pages, which have a interwiki in the destination wiki. Now the interwiki is skipped, when using a target namespace. Change-Id: I148e124016cacac0e0c6c6eb8c7e8a2e85802565 --- RELEASE-NOTES-1.20 | 1 + includes/Import.php | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES-1.20 b/RELEASE-NOTES-1.20 index 0b6cd177e0..0e8cdc09e6 100644 --- a/RELEASE-NOTES-1.20 +++ b/RELEASE-NOTES-1.20 @@ -79,6 +79,7 @@ production. * (bug 35069) On history pages, the " . . " separator after the number of characters changed in a revision is now suppressed if no text would follow. * (bug 18704) Add a unique CSS class or ID to the tagfilter table row at RecentChanges +* (bug 33564) transwiki import sometimes result in invalid title. === API changes in 1.20 === * (bug 34316) Add ability to retrieve maximum upload size from MediaWiki API. diff --git a/includes/Import.php b/includes/Import.php index 607d878b59..9ebc34c91b 100644 --- a/includes/Import.php +++ b/includes/Import.php @@ -786,7 +786,9 @@ class WikiImporter { $origTitle = Title::newFromText( $workTitle ); if( !is_null( $this->mTargetNamespace ) && !is_null( $origTitle ) ) { - $title = Title::makeTitle( $this->mTargetNamespace, + # makeTitleSafe, because $origTitle can have a interwiki (different setting of interwiki map) + # and than dbKey can begin with a lowercase char + $title = Title::makeTitleSafe( $this->mTargetNamespace, $origTitle->getDBkey() ); } else { $title = Title::newFromText( $workTitle ); -- 2.20.1