From 7f52b43aa8d0c24c1518849011380cac045eb11f Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Thu, 10 Apr 2008 08:42:36 +0000 Subject: [PATCH] Add CentralAuth cookies to the XVO header --- includes/DefaultSettings.php | 3 +++ includes/OutputPage.php | 19 ++++++++++++++----- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index b92c012bec..5cd275f9bc 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -1501,6 +1501,9 @@ $wgCookiePath = '/'; $wgCookieSecure = ($wgProto == 'https'); $wgDisableCookieCheck = false; +/** A list of cookies that vary the cache (for use by extensions) */ +$wgCacheVaryCookies = array(); + /** Override to customise the session name */ $wgSessionName = false; diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 70f6f121d8..4440dbccea 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -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() { -- 2.20.1