X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FSetup.php;h=72ed1fd2c90f46dcc27f1d2b857a9c10203d3dea;hb=f193271cffbca25d01df6af3b33418b0721b1d5f;hp=01ba1e8422a2200d2f6c49585626dd1df6641bf0;hpb=a0b8d8e1f5cb56e2ee5bd8abc3703ea0f084deb6;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Setup.php b/includes/Setup.php index 01ba1e8422..72ed1fd2c9 100644 --- a/includes/Setup.php +++ b/includes/Setup.php @@ -521,35 +521,6 @@ if ( $wgSharedDB && $wgSharedTables ) { // is complete. define( 'MW_SERVICE_BOOTSTRAP_COMPLETE', 1 ); -// Install a header callback to prevent caching of responses with cookies (T127993) -if ( !$wgCommandLineMode ) { - header_register_callback( function () { - $headers = []; - foreach ( headers_list() as $header ) { - list( $name, $value ) = explode( ':', $header, 2 ); - $headers[strtolower( trim( $name ) )][] = trim( $value ); - } - - if ( isset( $headers['set-cookie'] ) ) { - $cacheControl = isset( $headers['cache-control'] ) - ? implode( ', ', $headers['cache-control'] ) - : ''; - - if ( !preg_match( '/(?:^|,)\s*(?:private|no-cache|no-store)\s*(?:$|,)/i', $cacheControl ) ) { - header( 'Expires: Thu, 01 Jan 1970 00:00:00 GMT' ); - header( 'Cache-Control: private, max-age=0, s-maxage=0' ); - MediaWiki\Logger\LoggerFactory::getInstance( 'cache-cookies' )->warning( - 'Cookies set on {url} with Cache-Control "{cache-control}"', [ - 'url' => WebRequest::getGlobalRequestURL(), - 'cookies' => $headers['set-cookie'], - 'cache-control' => $cacheControl ?: '', - ] - ); - } - } - } ); -} - MWExceptionHandler::installHandler(); require_once "$IP/includes/compat/normal/UtfNormalUtil.php";