Use underscores when searching the page table, not spaces

The old code replaced underscores with spaces, which was backwards.
Also we don't need to look for underscores or spaces in namespaces,
because they are all integers.
This commit is contained in:
Brent Laabs
2016-12-27 19:07:38 -08:00
parent 7394da4c67
commit 500d441b4b

View File

@ -130,8 +130,8 @@ class Extension {
// Build a blacklist of pages that are not supposed to be link
// targets. This includes the current page.
$blackList = str_replace( '_', ' ',
'("' . implode( '", "',$wgLinkTitlesBlackList ) . '", "' .
$blackList = str_replace( ' ', '_',
'("' . implode( '","',$wgLinkTitlesBlackList ) . '","' .
addslashes( self::$currentTitle->getDbKey() ) . '")' );
$currentNamespace[] = $title->getNamespace();
@ -148,7 +148,7 @@ class Extension {
$weightSelect = $weightSelect . " WHEN " . $namspacevalue . " THEN " . $currentWeight . PHP_EOL;
}
$weightSelect = $weightSelect . " END ";
$namespacesClause = str_replace( '_', ' ','(' . implode( ', ',$namespaces ) . ')' );
$namespacesClause = '(' . implode( ', ', $namespaces ) . ')';
// Build an SQL query and fetch all page titles ordered by length from
// shortest to longest. Only titles from 'normal' pages (namespace uid
@ -477,6 +477,6 @@ private static function BuildDelimiters() {
}
wfDebugLog('LinkTitles', $text , 'private');
}
}
}
// vim: ts=2:sw=2:noet:comments^=\:///