From: Brion Vibber Date: Tue, 29 Jan 2008 01:28:27 +0000 (+0000) Subject: Apply live hack from Wikimedia code base -- more verbose reporting and protection... X-Git-Tag: 1.31.0-rc.0~49729 X-Git-Url: https://git.cyclocoop.org//%22?a=commitdiff_plain;h=632ae3ba2e81a0a6f27e63cd54351ba69c63688b;p=lhc%2Fweb%2Fwiklou.git Apply live hack from Wikimedia code base -- more verbose reporting and protection against invalid titles in conflict resolution for namespaceDupes --- 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' );