r53636 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r53635‎ | r53636 | r53637 >
Date:03:59, 22 July 2009
Author:mrzman
Status:deferred
Tags:
Comment:
Do real title normalization rather than just replacing spaces with underscores
Modified paths:
  • /trunk/extensions/IndexFunction/SpecialIndex.php (modified) (history)

Diff [purge]

Index: trunk/extensions/IndexFunction/SpecialIndex.php
@@ -63,12 +63,18 @@
6464 $keys = array_keys( $list );
6565 $set = '(' . implode(',', $keys) . ')';
6666
67 - $excludecats = wfMsg('index-exclude-categories');
68 - if ($excludecats) {
69 - $excludecats = str_replace(' ', '_', $excludecats);
70 - $excludecats = explode( '\n', $excludecats );
71 - foreach( $excludecats as $index => $cat ) {
72 - $excludecats[$index] = $dbr->addQuotes( $cat );
 67+ $exclude = wfMsg('index-exclude-categories');
 68+ $excludecats = array();
 69+ if ($exclude) {
 70+ $exclude = explode( '\n', $exclude );
 71+ foreach( $exclude as $cat ) {
 72+ if (!$cat) {
 73+ continue;
 74+ }
 75+ $cat = Title::newFromText( $cat, NS_CATEGORY );
 76+ if ( !is_null($cat) ) {
 77+ $excludecats[] = $dbr->addQuotes( $cat->getDBkey() );
 78+ }
7379 }
7480 $excludecats = 'AND cl_to NOT IN (' . implode(',', $excludecats) . ')';
7581 } else {

Status & tagging log