(bug 33564) transwiki import sometimes result in invalid title
authorumherirrender <umherirrender_de.wp@web.de>
Sat, 7 Apr 2012 12:40:01 +0000 (14:40 +0200)
committerBrion Vibber <brion@pobox.com>
Mon, 9 Apr 2012 19:25:00 +0000 (12:25 -0700)
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
includes/Import.php

index 0b6cd17..0e8cdc0 100644 (file)
@@ -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.
index 607d878..9ebc34c 100644 (file)
@@ -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 );