r45735 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r45734‎ | r45735 | r45736 >
Date:18:07, 14 January 2009
Author:ialex
Status:ok
Tags:
Comment:
(bug 17010) maintenance/namespaceDupes.php now add the suffix recursively if the destination page exists
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/maintenance/namespaceDupes.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/namespaceDupes.php
@@ -224,12 +224,19 @@
225225 function resolveConflict( $row, $resolvable, $suffix ) {
226226 if( !$resolvable ) {
227227 echo "... *** old title {$row->title}\n";
228 - $row->title .= $suffix;
229 - echo "... *** new title {$row->title}\n";
230 - $title = Title::makeTitleSafe( $row->namespace, $row->title );
231 - if ( ! $title ) {
232 - echo "... !!! invalid title\n";
233 - return false;
 228+ while( true ) {
 229+ $row->title .= $suffix;
 230+ echo "... *** new title {$row->title}\n";
 231+ $title = Title::makeTitleSafe( $row->namespace, $row->title );
 232+ if ( ! $title ) {
 233+ echo "... !!! invalid title\n";
 234+ return false;
 235+ }
 236+ if ( $id = $title->getArticleId() ) {
 237+ echo "... *** page exists with ID $id ***\n";
 238+ } else {
 239+ break;
 240+ }
234241 }
235242 echo "... *** using suffixed form [[" . $title->getPrefixedText() . "]] ***\n";
236243 }
Index: trunk/phase3/RELEASE-NOTES
@@ -39,12 +39,17 @@
4040 * (bug 16852) padleft and padright now accept multiletter pad characters
4141
4242 === Bug fixes in 1.15 ===
43 -* Fixing the caching issue by using -{T|xxx}- syntax (only applies on wiki with LanguageConverter class)
44 -* Improving the efficiency by using -{A|xxx}- syntax (only applies on wiki with LanguageConverter class)
 43+* Fixing the caching issue by using -{T|xxx}- syntax (only applies on wiki with
 44+ LanguageConverter class)
 45+* Improving the efficiency by using -{A|xxx}- syntax (only applies on wiki with
 46+ LanguageConverter class)
4547 * (bug 16968) Special:Upload no longer throws useless warnings.
4648 * (bug 15470) Special:Upload no longer force-capitalizes titles
47 -* (bug 17000) Special:RevisionDelete now checks if the database is locked before trying to delete the edit.
 49+* (bug 17000) Special:RevisionDelete now checks if the database is locked before
 50+ trying to delete the edit.
4851 * (bug 16852) padleft and padright now handle multibyte characters correctly
 52+* (bug 17010) maintenance/namespaceDupes.php now add the suffix recursively if
 53+ the destination page exists
4954
5055 == API changes in 1.15 ==
5156 * (bug 16798) JSON encoding errors for some characters outside the BMP

Status & tagging log