From 2ad0cafca6f7e6075ce9b44c0ec5db124595c6c4 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Wed, 16 Aug 2006 20:28:59 +0000 Subject: [PATCH] * (bug 3512) namespaceDupes now handles spaces and initial caps properly --- RELEASE-NOTES | 1 + maintenance/namespaceDupes.php | 13 +++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index d2d04ed403..9934056c52 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -134,6 +134,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN point as with Special:Allpages, rather than a pure limit. * Clean up tab order on Special:Blockip * (bug 5969) Clean up tab order on Special:Userlogin forms +* (bug 3512) namespaceDupes now handles spaces and initial caps properly == Languages updated == diff --git a/maintenance/namespaceDupes.php b/maintenance/namespaceDupes.php index ad56eee7c1..acd3a7085c 100644 --- a/maintenance/namespaceDupes.php +++ b/maintenance/namespaceDupes.php @@ -111,12 +111,12 @@ class NamespaceConflictChecker { } function reportConflict( $row, $suffix ) { - $newTitle = Title::makeTitle( $row->namespace, $row->title ); + $newTitle = Title::makeTitleSafe( $row->namespace, $row->title ); printf( "... %d (0,\"%s\") -> (%d,\"%s\") [[%s]]\n", $row->id, $row->oldtitle, - $row->namespace, - $row->title, + $newTitle->getNamespace(), + $newTitle->getDbKey(), $newTitle->getPrefixedText() ); $id = $newTitle->getArticleId(); @@ -131,7 +131,7 @@ class NamespaceConflictChecker { function resolveConflict( $row, $resolvable, $suffix ) { if( !$resolvable ) { $row->title .= $suffix; - $title = Title::makeTitle( $row->namespace, $row->title ); + $title = Title::makeTitleSafe( $row->namespace, $row->title ); echo "... *** using suffixed form [[" . $title->getPrefixedText() . "]] ***\n"; } $tables = $this->newSchema() @@ -146,10 +146,11 @@ class NamespaceConflictChecker { function resolveConflictOn( $row, $table ) { $fname = 'NamespaceConflictChecker::resolveConflictOn'; echo "... resolving on $table... "; + $newTitle = Title::makeTitleSafe( $row->namespace, $row->title ); $this->db->update( $table, array( - "{$table}_namespace" => $row->namespace, - "{$table}_title" => $row->title, + "{$table}_namespace" => $newTitle->getNamespace(), + "{$table}_title" => $newTitle->getDbKey(), ), array( "{$table}_namespace" => 0, -- 2.20.1