X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FSetup.php;h=d450bdd33cebbd8df473cea732a33797e735924a;hb=17d8a57bde68073290f4b548ad28658181a11d0e;hp=cfb2ac16fa25df2e0c67500c522728ba073c8bd7;hpb=50ea56e349d62c48c69c22bbdf91514c7a9e77e1;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Setup.php b/includes/Setup.php index cfb2ac16fa..d450bdd33c 100644 --- a/includes/Setup.php +++ b/includes/Setup.php @@ -52,6 +52,17 @@ if ( ini_get( 'mbstring.func_overload' ) ) { die( 'MediaWiki does not support installations where mbstring.func_overload is non-zero.' ); } +// Define MW_ENTRY_POINT if it's not already, so that config code can check the +// value without using defined() +if ( !defined( 'MW_ENTRY_POINT' ) ) { + /** + * The entry point, which may be either the script filename without the + * file extension, or "cli" for maintenance scripts, or "unknown" for any + * entry point that does not set the constant. + */ + define( 'MW_ENTRY_POINT', 'unknown' ); +} + // Start the autoloader, so that extensions can derive classes from core files require_once "$IP/includes/AutoLoader.php"; @@ -429,6 +440,13 @@ if ( $wgEnableEmail ) { $wgUsersNotifiedOnAllChanges = []; } +// $wgSysopEmailBans deprecated in 1.34 +if ( isset( $wgSysopEmailBans ) && $wgSysopEmailBans === false ) { + foreach ( $wgGroupPermissions as $group => $_ ) { + unset( $wgGroupPermissions[$group]['blockemail'] ); + } +} + if ( $wgMetaNamespace === false ) { $wgMetaNamespace = str_replace( ' ', '_', $wgSitename ); } @@ -710,7 +728,7 @@ if ( is_null( $wgLocaltimezone ) ) { date_default_timezone_set( $wgLocaltimezone ); if ( is_null( $wgLocalTZoffset ) ) { - $wgLocalTZoffset = date( 'Z' ) / 60; + $wgLocalTZoffset = (int)date( 'Z' ) / 60; } // The part after the System| is ignored, but rest of MW fills it // out as the local offset. @@ -797,22 +815,17 @@ if ( !defined( 'MW_NO_SESSION' ) && !$wgCommandLineMode ) { // Initialize the session try { $session = MediaWiki\Session\SessionManager::getGlobalSession(); - } catch ( OverflowException $ex ) { - if ( isset( $ex->sessionInfos ) && count( $ex->sessionInfos ) >= 2 ) { - // The exception is because the request had multiple possible - // sessions tied for top priority. Report this to the user. - $list = []; - foreach ( $ex->sessionInfos as $info ) { - $list[] = $info->getProvider()->describe( $wgContLang ); - } - $list = $wgContLang->listToText( $list ); - throw new HttpError( 400, - Message::newFromKey( 'sessionmanager-tie', $list )->inLanguage( $wgContLang )->plain() - ); + } catch ( MediaWiki\Session\SessionOverflowException $ex ) { + // The exception is because the request had multiple possible + // sessions tied for top priority. Report this to the user. + $list = []; + foreach ( $ex->getSessionInfos() as $info ) { + $list[] = $info->getProvider()->describe( $wgContLang ); } - - // Not the one we want, rethrow - throw $ex; + $list = $wgContLang->listToText( $list ); + throw new HttpError( 400, + Message::newFromKey( 'sessionmanager-tie', $list )->inLanguage( $wgContLang )->plain() + ); } if ( $session->isPersistent() ) {