1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-01-18 14:48:28 +01:00

Merge pull request #6048 from JoshyPHP/ticket/16602

[ticket/16602] Check for mbstring extension support on install
This commit is contained in:
Marc Alexander 2020-09-19 10:50:07 +02:00
commit 43eeb008fa
No known key found for this signature in database
GPG Key ID: 50E0D2423696F995
3 changed files with 23 additions and 1 deletions

View File

@ -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",

View File

@ -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',

View File

@ -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)
*/