Only look for titles from normal pages (namespace = 0)

This commit is contained in:
Daniel Kraus
2012-05-20 15:02:57 +02:00
parent b0b30000c1
commit dee2149532
3 changed files with 7 additions and 2 deletions

View File

@ -1,5 +1,8 @@
Extension:LinkTitles Extension:LinkTitles
0.0.3: 2012-05-20
* Only look for page titles from 'normal' pages (namespace = 0).
0.0.2: 2012-05-20 0.0.2: 2012-05-20
* Prevent generation of self-references. * Prevent generation of self-references.
* Escape slashes in page titles before using them in a regexp. * Escape slashes in page titles before using them in a regexp.

View File

@ -47,11 +47,13 @@
// Build an SQL query and fetch all page titles ordered // Build an SQL query and fetch all page titles ordered
// by length from shortest to longest. // by length from shortest to longest.
// Only titles from 'normal' pages (namespace uid = 0)
// are returned.
$dbr = wfGetDB( DB_SLAVE ); $dbr = wfGetDB( DB_SLAVE );
$res = $dbr->select( $res = $dbr->select(
'page', 'page',
'page_title', 'page_title',
'', 'page_namespace = 0',
__METHOD__, __METHOD__,
array( 'ORDER BY' => 'length(page_title)' )); array( 'ORDER BY' => 'length(page_title)' ));

View File

@ -36,7 +36,7 @@
'name' => 'LinkTitles', 'name' => 'LinkTitles',
'author' => '[http://www.mediawiki.org/wiki/User:Bovender Daniel Kraus]', 'author' => '[http://www.mediawiki.org/wiki/User:Bovender Daniel Kraus]',
'url' => 'http://www.mediawiki.org/wiki/Extension:LinkTitles', 'url' => 'http://www.mediawiki.org/wiki/Extension:LinkTitles',
'version' => '0.0.2', 'version' => '0.0.3',
'descriptionmsg' => 'linktitles-desc' 'descriptionmsg' => 'linktitles-desc'
); );