From: Tim Starling Date: Thu, 10 Apr 2008 08:42:36 +0000 (+0000) Subject: Add CentralAuth cookies to the XVO header X-Git-Tag: 1.31.0-rc.0~48468 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/comptes/ajouter.php?a=commitdiff_plain;h=7f52b43aa8d0c24c1518849011380cac045eb11f;p=lhc%2Fweb%2Fwiklou.git Add CentralAuth cookies to the XVO header --- 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() {