From 0587e96140cc150d50c1bb984aef2464c8ad3856 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sat, 17 Jun 2006 12:51:41 +0000 Subject: [PATCH] * namespaceDupes.php can now accept an arbitrary prefix, for checking rogue interwikis and such. Not yet fully automated. --- RELEASE-NOTES | 3 +++ maintenance/namespaceDupes.php | 16 +++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index f896e0ec79..7163b186be 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -515,6 +515,9 @@ Some default configuration options have changed: * Update to Slovak translation (sk) * Update to Alemannic localization (gsw) * (bug 6300) Bug fixes for sr: variants +* namespaceDupes.php can now accept an arbitrary prefix, for checking rogue + interwikis and such. Not yet fully automated. + == Compatibility == diff --git a/maintenance/namespaceDupes.php b/maintenance/namespaceDupes.php index 6ced232a89..929bf73884 100644 --- a/maintenance/namespaceDupes.php +++ b/maintenance/namespaceDupes.php @@ -75,6 +75,14 @@ class NamespaceConflictChecker { } return $ok; } + + /** + * @fixme: do this for reals + */ + function checkInterwiki( $prefix, $fix, $suffix = '' ) { + echo "Checking interwiki prefix \"$prefix\"\n"; + return $this->checkNamespace( 0, $prefix, $fix, $suffix ); + } function getConflicts( $ns, $name ) { $page = $this->newSchema() ? 'page' : 'cur'; @@ -164,9 +172,15 @@ $wgTitle = Title::newFromText( 'Namespace title conflict cleanup script' ); $fix = isset( $options['fix'] ); $suffix = isset( $options['suffix'] ) ? $options['suffix'] : ''; +$prefix = isset( $options['prefix'] ) ? $options['prefix'] : ''; $dbw =& wfGetDB( DB_MASTER ); $duper = new NamespaceConflictChecker( $dbw ); -$retval = $duper->checkAll( $fix, $suffix ); + +if( $prefix ) { + $retval = $duper->checkInterwiki( $prefix, $fix, $suffix ); +} else { + $retval = $duper->checkAll( $fix, $suffix ); +} if( $retval ) { echo "\nLooks good!\n"; -- 2.20.1