From 3b891947886106188eaaadd07046174fa78167b1 Mon Sep 17 00:00:00 2001 From: Max Semenik Date: Mon, 13 Jun 2016 14:28:28 -0700 Subject: [PATCH] Move mbstring initializaton to Setup.php, add checks Bug: T137509 Change-Id: Ib3496c9465a7b229b97793c6fa5dafb878c04968 --- includes/Setup.php | 7 +++++++ languages/Language.php | 2 -- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/includes/Setup.php b/includes/Setup.php index 2c78061750..878b147b61 100644 --- a/includes/Setup.php +++ b/includes/Setup.php @@ -45,6 +45,13 @@ if ( !isset( $wgVersion ) ) { die( 1 ); } +if ( function_exists( 'mb_internal_encoding' ) ) { + mb_internal_encoding( 'UTF-8' ); +} elseif ( !defined( 'MEDIAWIKI_INSTALL' ) ) { + echo "Error: the mbstring PHP extension is required\n"; + die( 1 ); +} + // Set various default paths sensibly... $ps_default = Profiler::instance()->scopedProfileIn( $fname . '-defaults' ); diff --git a/languages/Language.php b/languages/Language.php index 0a6ccd3eb2..f0c7d76c0a 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -30,8 +30,6 @@ if ( !defined( 'MEDIAWIKI' ) ) { exit( 1 ); } -mb_internal_encoding( 'UTF-8' ); - use CLDRPluralRuleParser\Evaluator; /** -- 2.20.1