* (bug 3512) namespaceDupes now handles spaces and initial caps properly
authorBrion Vibber <brion@users.mediawiki.org>
Wed, 16 Aug 2006 20:28:59 +0000 (20:28 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Wed, 16 Aug 2006 20:28:59 +0000 (20:28 +0000)
RELEASE-NOTES
maintenance/namespaceDupes.php

index d2d04ed..9934056 100644 (file)
@@ -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 ==
index ad56eee..acd3a70 100644 (file)
@@ -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,