From 632ae3ba2e81a0a6f27e63cd54351ba69c63688b Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Tue, 29 Jan 2008 01:28:27 +0000 Subject: [PATCH] Apply live hack from Wikimedia code base -- more verbose reporting and protection against invalid titles in conflict resolution for namespaceDupes --- maintenance/namespaceDupes.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/maintenance/namespaceDupes.php b/maintenance/namespaceDupes.php index 2b213e9992..dcde7c6103 100644 --- a/maintenance/namespaceDupes.php +++ b/maintenance/namespaceDupes.php @@ -23,7 +23,7 @@ $options = array( 'fix', 'suffix', 'help' ); require_once( 'commandLine.inc' ); if(isset( $options['help'] ) ) { -print <<] [--help] --help : this help message --fix : attempt to automatically fix errors @@ -33,7 +33,7 @@ usage: namespaceDupes.php [--fix] [--suffix=] [--help] in place of the standard namespace list. --verbose : Display output for checked namespaces without conflicts -END; +ENDS; die; } @@ -218,8 +218,14 @@ class NamespaceConflictChecker { function resolveConflict( $row, $resolvable, $suffix ) { if( !$resolvable ) { + echo "... *** old title {$row->title}\n"; $row->title .= $suffix; + echo "... *** new title {$row->title}\n"; $title = Title::makeTitleSafe( $row->namespace, $row->title ); + if ( ! $title ) { + echo "... !!! invalid title\n"; + return false; + } echo "... *** using suffixed form [[" . $title->getPrefixedText() . "]] ***\n"; } $tables = array( 'page' ); -- 2.20.1