(bug 13718) Return the proper continue parameter for cmsort=timestamp
[lhc/web/wiklou.git] / includes / OutputPage.php
index 8bfb7e6..4440dbc 100644 (file)
@@ -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() {