Index: trunk/extensions/IndexFunction/SpecialIndex.php |
— | — | @@ -63,12 +63,18 @@ |
64 | 64 | $keys = array_keys( $list ); |
65 | 65 | $set = '(' . implode(',', $keys) . ')'; |
66 | 66 | |
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 | + } |
73 | 79 | } |
74 | 80 | $excludecats = 'AND cl_to NOT IN (' . implode(',', $excludecats) . ')'; |
75 | 81 | } else { |