X-Git-Url: https://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2FSetup.php;h=2c315a31554159ae077c7f3ce2ada0597710a61d;hb=6bd99f8f40f957a93d65febe861f181b252d3aeb;hp=c9fe8d0fe812b389a0c9f7f8d7d619e00e417302;hpb=801c6810a741cffed1174267958bd3426fd1d191;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Setup.php b/includes/Setup.php index c9fe8d0fe8..2c315a3155 100644 --- a/includes/Setup.php +++ b/includes/Setup.php @@ -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 @@ -37,10 +39,9 @@ if ( !defined( 'MEDIAWIKI' ) ) { * Pre-config setup: Before loading LocalSettings.php */ -// Get profiler configuraton -$wgProfiler = []; -if ( file_exists( "$IP/StartProfiler.php" ) ) { - require "$IP/StartProfiler.php"; +// Sanity check (T5782, T122807) +if ( ini_get( 'mbstring.func_overload' ) ) { + die( 'MediaWiki does not support installations where mbstring.func_overload is non-zero.' ); } // Start the autoloader, so that extensions can derive classes from core files @@ -85,6 +86,11 @@ MediaWiki\HeaderCallback::register(); * Load LocalSettings.php */ +if ( is_readable( "$IP/StartProfiler.php" ) ) { + // @deprecated since 1.32: Use LocalSettings.php instead. + require "$IP/StartProfiler.php"; +} + if ( defined( 'MW_CONFIG_CALLBACK' ) ) { call_user_func( MW_CONFIG_CALLBACK ); } else { @@ -280,7 +286,6 @@ if ( !$wgLocalFileRepo ) { 'name' => 'local', 'directory' => $wgUploadDirectory, 'scriptDirUrl' => $wgScriptPath, - 'scriptExtension' => '.php', 'url' => $wgUploadBaseUrl ? $wgUploadBaseUrl . $wgUploadPath : $wgUploadPath, 'hashLevels' => $wgHashedUploadDirectory ? 2 : 0, 'thumbScriptUrl' => $wgThumbnailScriptPath, @@ -358,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 @@ -528,9 +527,9 @@ $wgJsMimeType = 'text/javascript'; $wgFileExtensions = array_values( array_diff( $wgFileExtensions, $wgFileBlacklist ) ); if ( $wgInvalidateCacheOnLocalSettingsChange ) { - MediaWiki\suppressWarnings(); + Wikimedia\suppressWarnings(); $wgCacheEpoch = max( $wgCacheEpoch, gmdate( 'YmdHis', filemtime( "$IP/LocalSettings.php" ) ) ); - MediaWiki\restoreWarnings(); + Wikimedia\restoreWarnings(); } if ( $wgNewUserLog ) { @@ -717,9 +716,9 @@ wfMemoryLimit(); * explicitly set. Inspired by phpMyAdmin's treatment of the problem. */ if ( is_null( $wgLocaltimezone ) ) { - MediaWiki\suppressWarnings(); + Wikimedia\suppressWarnings(); $wgLocaltimezone = date_default_timezone_get(); - MediaWiki\restoreWarnings(); + Wikimedia\restoreWarnings(); } date_default_timezone_set( $wgLocaltimezone ); @@ -741,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' ) { @@ -874,7 +879,7 @@ if ( !defined( 'MW_NO_SESSION' ) && !$wgCommandLineMode ) { ) { // Start the PHP-session for backwards compatibility session_id( $session->getId() ); - MediaWiki\quietCall( 'session_start' ); + Wikimedia\quietCall( 'session_start' ); } unset( $session );