$pdbks = array();
$colours = array();
$sk = $this->mOptions->getSkin();
- $linkCache =& LinkCache::singleton();
+ $linkCache = LinkCache::singleton();
if ( !empty( $this->mLinkHolders['namespaces'] ) ) {
wfProfileIn( $fname.'-check' );
# Not in the link cache, add it to the query
if ( !isset( $current ) ) {
$current = $ns;
- $query = "SELECT page_id, page_namespace, page_title";
- if ( $threshold > 0 ) {
- $query .= ', page_len, page_is_redirect';
- }
+ $query = "SELECT page_id, page_namespace, page_title, page_len, page_is_redirect";
$query .= " FROM $page WHERE (page_namespace=$ns AND page_title IN(";
} elseif ( $current != $ns ) {
$current = $ns;
while ( $s = $dbr->fetchObject($res) ) {
$title = Title::makeTitle( $s->page_namespace, $s->page_title );
$pdbk = $title->getPrefixedDBkey();
- $linkCache->addGoodLinkObj( $s->page_id, $title );
+ $linkCache->addGoodLinkObj( $s->page_id, $title, $s->page_len, $s->page_is_redirect );
$this->mOutput->addLink( $title, $s->page_id );
$colours[$pdbk] = ( $threshold == 0 || (
wfProfileOut( $fname.'-check' );
# Do a second query for different language variants of links and categories
- if($wgContLang->hasVariants()){
+ if( $wgContLang->hasVariants() ) {
$linkBatch = new LinkBatch();
$variantMap = array(); // maps $pdbkey_Variant => $keys (of link holders)
$categoryMap = array(); // maps $category_variant => $category (dbkeys)
}
- if(!$linkBatch->isEmpty()){
+ if ( !$linkBatch->isEmpty() ){
// construct query
$titleClause = $linkBatch->constructSet('page', $dbr);
- $variantQuery = "SELECT page_id, page_namespace, page_title";
- if ( $threshold > 0 ) {
- $variantQuery .= ', page_len, page_is_redirect';
- }
+ $variantQuery = "SELECT page_id, page_namespace, page_title, page_len, page_is_redirect";
$variantQuery .= " FROM $page WHERE $titleClause";
if ( $options & RLH_FOR_UPDATE ) {
$holderKeys = array();
if(isset($variantMap[$varPdbk])){
$holderKeys = $variantMap[$varPdbk];
- $linkCache->addGoodLinkObj( $s->page_id, $variantTitle );
+ $linkCache->addGoodLinkObj( $s->page_id, $variantTitle, $s->page_len, $s->page_is_redirect );
$this->mOutput->addLink( $variantTitle, $s->page_id );
}