Merge "OutputPage: Remove appending of wgStyleVersion to legacy resources"
[lhc/web/wiklou.git] / includes / Setup.php
index 6825c7b..2c315a3 100644 (file)
@@ -24,6 +24,8 @@
  * @file
  */
 use MediaWiki\MediaWikiServices;
+use Wikimedia\Rdbms\LBFactory;
+use Wikimedia\Rdbms\ChronologyProtector;
 
 /**
  * This file is not a valid entry point, perform no further processing unless
@@ -361,12 +363,6 @@ foreach ( $wgForeignFileRepos as &$repo ) {
 }
 unset( $repo ); // no global pollution; destroy reference
 
-// Convert this deprecated setting to modern system
-if ( $wgExperimentalHtmlIds ) {
-       wfDeprecated( '$wgExperimentalHtmlIds', '1.30' );
-       $wgFragmentMode = [ 'html5-legacy', 'html5' ];
-}
-
 $rcMaxAgeDays = $wgRCMaxAge / ( 3600 * 24 );
 if ( $wgRCFilterByAge ) {
        // Trim down $wgRCLinkDays so that it only lists links which are valid
@@ -744,9 +740,15 @@ MediaWikiServices::getInstance()->getDBLoadBalancerFactory()->setRequestInfo( [
        'IPAddress' => $wgRequest->getIP(),
        'UserAgent' => $wgRequest->getHeader( 'User-Agent' ),
        'ChronologyProtection' => $wgRequest->getHeader( 'ChronologyProtection' ),
-       // The cpPosIndex cookie has no prefix and is set by MediaWiki::preOutputCommit()
-       'ChronologyPositionIndex' =>
-               $wgRequest->getInt( 'cpPosIndex', (int)$wgRequest->getCookie( 'cpPosIndex', '' ) )
+       'ChronologyPositionIndex' => $wgRequest->getInt(
+               'cpPosIndex',
+               LBFactory::getCPIndexFromCookieValue(
+                       // The cookie has no prefix and is set by MediaWiki::preOutputCommit()
+                       $wgRequest->getCookie( 'cpPosIndex', '' ),
+                       // Mitigate broken client-side cookie expiration handling (T190082)
+                       time() - ChronologyProtector::POSITION_COOKIE_TTL
+               )
+       )
 ] );
 // Make sure that object caching does not undermine the ChronologyProtector improvements
 if ( $wgRequest->getCookie( 'UseDC', '' ) === 'master' ) {