From 72e90545454c0e014318fa3c81658e035aac58c1 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Wed, 10 Jun 2009 13:00:47 +0200 Subject: applying patch to version 1.15.0 --- maintenance/namespaceDupes.php | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'maintenance/namespaceDupes.php') diff --git a/maintenance/namespaceDupes.php b/maintenance/namespaceDupes.php index fcc7d3a1..c5b3ce96 100644 --- a/maintenance/namespaceDupes.php +++ b/maintenance/namespaceDupes.php @@ -224,12 +224,19 @@ 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; + while( true ) { + $row->title .= $suffix; + echo "... *** new title {$row->title}\n"; + $title = Title::makeTitleSafe( $row->namespace, $row->title ); + if ( ! $title ) { + echo "... !!! invalid title\n"; + return false; + } + if ( $id = $title->getArticleId() ) { + echo "... *** page exists with ID $id ***\n"; + } else { + break; + } } echo "... *** using suffixed form [[" . $title->getPrefixedText() . "]] ***\n"; } -- cgit v1.2.3-54-g00ecf