X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2FSetup.php;h=6838c372608fb3accafae471ab4f8365a783ccf0;hp=cfb2ac16fa25df2e0c67500c522728ba073c8bd7;hb=9283760f340c6971d748fb574a35453fa7928807;hpb=eefd0e31facfd32abbfa0effe6e1906f09c54cd5 diff --git a/includes/Setup.php b/includes/Setup.php index cfb2ac16fa..6838c37260 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 ); } @@ -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() ) {