foreach( $wgNamespaceAliases as $name => $ns ) {
$spaces[$name] = $ns;
}
- foreach( $wgContLang->namespaceAliases as $name => $ns ) {
+ foreach( $wgContLang->getNamespaceAliases() as $name => $ns ) {
$spaces[$name] = $ns;
}
* @param $suffix String Suffix to append to renamed articles
*/
private function checkNamespace( $ns, $name, $fix, $suffix = '' ) {
- if( $ns == 0 ) {
- $header = "Checking interwiki prefix: \"$name\"\n";
- } else {
- $header = "Checking namespace $ns: \"$name\"\n";
- }
-
$conflicts = $this->getConflicts( $ns, $name );
$count = count( $conflicts );
if( $count == 0 ) {
- $this->output( $header . "... no conflict detected!\n" );
return true;
}
- $this->output( $header . "... $count conflicts detected:\n" );
$ok = true;
foreach( $conflicts as $row ) {
$resolvable = $this->reportConflict( $row, $suffix );
$table = $this->db->tableName( $page );
$prefix = $this->db->strencode( $name );
- $likeprefix = str_replace( '_', '\\_', $prefix);
$encNamespace = $this->db->addQuotes( $ns );
$titleSql = "TRIM(LEADING '$prefix:' FROM {$page}_title)";
$titleSql AS title
FROM {$table}
WHERE {$page}_namespace=0
- AND {$page}_title LIKE '$likeprefix:%'";
+ AND {$page}_title " . $this->db->buildLike( $name . ':', $this->db->anyString() );
$result = $this->db->query( $sql, __METHOD__ );
}
$this->output( "... *** using suffixed form [[" . $title->getPrefixedText() . "]] ***\n" );
}
- $tables = array( 'page' => 'page' );
- foreach( $tables as $table ) {
- $this->resolveConflictOn( $row, $table, $prefix );
- }
+ $this->resolveConflictOn( $row, 'page', 'page' );
return true;
}