(bug 13718) Return the proper continue parameter for cmsort=timestamp
[lhc/web/wiklou.git] / includes / OutputPage.php
index 482174b..4440dbc 100644 (file)
@@ -287,8 +287,8 @@ class OutputPage {
                $pageTable = $dbr->tableName( 'page' );
                $where = $lb->constructSet( 'page', $dbr );
                $propsTable = $dbr->tableName( 'page_props' );
-               $sql = "SELECT page_id, page_namespace, page_title, pp_value FROM $pageTable LEFT JOIN $propsTable " . 
-                       " ON pp_propname='hiddencat' AND pp_page=page_id WHERE $where";
+               $sql = "SELECT page_id, page_namespace, page_title, page_len, page_is_redirect, pp_value
+                       FROM $pageTable LEFT JOIN $propsTable ON pp_propname='hiddencat' AND pp_page=page_id WHERE $where";
                $res = $dbr->query( $sql, __METHOD__ );
 
                # Add the results to the link cache
@@ -458,7 +458,7 @@ class OutputPage {
                        $popts, true, true, $this->mRevisionId );
                $popts->setTidy(false);
                if ( $cache && $article && $parserOutput->getCacheTime() != -1 ) {
-                       $parserCache =& ParserCache::singleton();
+                       $parserCache = ParserCache::singleton();
                        $parserCache->save( $parserOutput, $article, $wgUser );
                }
 
@@ -518,7 +518,7 @@ class OutputPage {
         * @return bool True if successful, else false.
         */
        public function tryParserCache( &$article, $user ) {
-               $parserCache =& ParserCache::singleton();
+               $parserCache = ParserCache::singleton();
                $parserOutput = $parserCache->get( $article, $user );
                if ( $parserOutput !== false ) {
                        $this->addParserOutput( $parserOutput );
@@ -544,11 +544,20 @@ class OutputPage {
        }
 
        function getCacheVaryCookies() {
-               global $wgCookiePrefix;
-               return array( 
-                       "{$wgCookiePrefix}Token",
-                       "{$wgCookiePrefix}LoggedOut",
-                       session_name() );
+               global $wgCookiePrefix, $wgCacheVaryCookies;
+               static $cookies;
+               if ( $cookies === null ) {
+                       $cookies = array_merge( 
+                               array(
+                                       "{$wgCookiePrefix}Token",
+                                       "{$wgCookiePrefix}LoggedOut",
+                                       session_name()
+                               ),
+                               $wgCacheVaryCookies
+                       );
+                       wfRunHooks('GetCacheVaryCookies', array( $this, &$cookies ) );
+               }
+               return $cookies;
        }
 
        function uncacheableBecauseRequestVars() {