(bug 13718) Return the proper continue parameter for cmsort=timestamp
[lhc/web/wiklou.git] / includes / Parser_OldPP.php
index 7462397..92a7e18 100644 (file)
@@ -4081,7 +4081,7 @@ class Parser_OldPP
                $pdbks = array();
                $colours = array();
                $sk = $this->mOptions->getSkin();
-               $linkCache =& LinkCache::singleton();
+               $linkCache = LinkCache::singleton();
 
                if ( !empty( $this->mLinkHolders['namespaces'] ) ) {
                        wfProfileIn( $fname.'-check' );
@@ -4120,10 +4120,7 @@ class Parser_OldPP
                                        # 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;
@@ -4150,7 +4147,7 @@ class Parser_OldPP
                                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 || (
@@ -4163,7 +4160,7 @@ class Parser_OldPP
                        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)
@@ -4210,14 +4207,11 @@ class Parser_OldPP
                                }
 
 
-                               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 ) {
@@ -4236,7 +4230,7 @@ class Parser_OldPP
                                                $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 );
                                                }