diff --git a/phpBB/composer.json b/phpBB/composer.json index 31ad38a6b4..d5acd3112c 100644 --- a/phpBB/composer.json +++ b/phpBB/composer.json @@ -27,6 +27,7 @@ "require": { "php": "^7.1.3", "ext-json": "*", + "ext-mbstring": "*", "bantu/ini-get-wrapper": "~1.0", "google/recaptcha": "~1.1", "guzzlehttp/guzzle": "~6.3", diff --git a/phpBB/language/en/install.php b/phpBB/language/en/install.php index 530c003026..bb8e28e83a 100644 --- a/phpBB/language/en/install.php +++ b/phpBB/language/en/install.php @@ -112,6 +112,8 @@ $lang = array_merge($lang, array( 'PCRE_UTF_SUPPORT_EXPLAIN' => 'phpBB will not run if your PHP installation is not compiled with UTF-8 support in the PCRE extension.', 'PHP_JSON_SUPPORT' => 'PHP JSON support', 'PHP_JSON_SUPPORT_EXPLAIN' => 'In order for phpBB to function correctly, the PHP JSON extension needs to be available.', + 'PHP_MBSTRING_SUPPORT' => 'PHP mbstring support', + 'PHP_MBSTRING_SUPPORT_EXPLAIN' => 'In order for phpBB to function correctly, the PHP mbstring extension needs to be available.', 'PHP_XML_SUPPORT' => 'PHP XML/DOM support', 'PHP_XML_SUPPORT_EXPLAIN' => 'In order for phpBB to function correctly, the PHP XML/DOM extension needs to be available.', 'PHP_SUPPORTED_DB' => 'Supported databases', diff --git a/phpBB/phpbb/install/module/requirements/task/check_server_environment.php b/phpBB/phpbb/install/module/requirements/task/check_server_environment.php index 41aa82623b..8f8b0e1934 100644 --- a/phpBB/phpbb/install/module/requirements/task/check_server_environment.php +++ b/phpBB/phpbb/install/module/requirements/task/check_server_environment.php @@ -14,7 +14,7 @@ namespace phpbb\install\module\requirements\task; /** - * Installer task that checks if the server meats phpBB requirements + * Installer task that checks if the server meets phpBB requirements */ class check_server_environment extends \phpbb\install\task_base { @@ -71,6 +71,9 @@ class check_server_environment extends \phpbb\install\task_base // Check for JSON support $this->check_json(); + // Check for mbstring support + $this->check_mbstring(); + // XML extension support check $this->check_xml(); @@ -155,6 +158,22 @@ class check_server_environment extends \phpbb\install\task_base $this->set_test_passed(false); } + /** + * Checks whether PHP's mbstring extension is available or not + */ + protected function check_mbstring() + { + if (@extension_loaded('mbstring')) + { + $this->set_test_passed(true); + return; + } + + $this->response_helper->add_error_message('PHP_MBSTRING_SUPPORT', 'PHP_MBSTRING_SUPPORT_EXPLAIN'); + + $this->set_test_passed(false); + } + /** * Checks whether or not the XML PHP extension is available (Required by the text formatter) */