From ca62538ce3c5160b429875f5187d1323fd9d28dc Mon Sep 17 00:00:00 2001 From: JoshyPHP Date: Wed, 16 Sep 2020 00:21:17 +0200 Subject: [PATCH 1/2] [ticket/16602] Check for mbstring extension support on install PHPBB3-16602 --- phpBB/language/en/install.php | 2 ++ .../task/check_server_environment.php | 21 ++++++++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) 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) */ From 5b0406cfdc10fd04dea7ceee75c9b987795cd702 Mon Sep 17 00:00:00 2001 From: JoshyPHP Date: Wed, 16 Sep 2020 00:42:34 +0200 Subject: [PATCH 2/2] [ticket/16602] Added mbstring to Composer requirements PHPBB3-16602 --- phpBB/composer.json | 1 + 1 file changed, 1 insertion(+) 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",