From 28288426d6db95be9cb065ade606fc7accfa6af3 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Mon, 17 Oct 2016 18:29:49 -0400 Subject: [PATCH 1/2] Check for required mbstring extension --- CRM/Utils/Check/Component/Env.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/CRM/Utils/Check/Component/Env.php b/CRM/Utils/Check/Component/Env.php index 2a370562eba0..f2b9bc977348 100644 --- a/CRM/Utils/Check/Component/Env.php +++ b/CRM/Utils/Check/Component/Env.php @@ -698,4 +698,23 @@ public function checkDbEngine() { return $messages; } + /** + * Check for required mbstring extension + * @return array + */ + public function checkMbstring() { + $messages = array(); + + if (!function_exists('mb_substr')) { + $messages[] = new CRM_Utils_Check_Message( + __FUNCTION__, + ts('The required PHP Multibyte String extension is not enabled on your server. Ask your system administrator to install it.'), + ts('Missing mbstring Extension'), + \Psr\Log\LogLevel::ERROR, + 'fa-server' + ); + } + return $messages; + } + } From ade9995eeaa5ab7a9c9e2c5a333cdfb4f5403aea Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Mon, 17 Oct 2016 19:55:54 -0400 Subject: [PATCH 2/2] Downgrade mbstring to warning, make usage conditional --- CRM/Utils/Check/Component/Env.php | 4 ++-- templates/CRM/Dashlet/Page/Blog.tpl | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CRM/Utils/Check/Component/Env.php b/CRM/Utils/Check/Component/Env.php index f2b9bc977348..6a96017204c5 100644 --- a/CRM/Utils/Check/Component/Env.php +++ b/CRM/Utils/Check/Component/Env.php @@ -708,9 +708,9 @@ public function checkMbstring() { if (!function_exists('mb_substr')) { $messages[] = new CRM_Utils_Check_Message( __FUNCTION__, - ts('The required PHP Multibyte String extension is not enabled on your server. Ask your system administrator to install it.'), + ts('The PHP Multibyte String extension is needed for CiviCRM to correctly handle user input among other functionality. Ask your system administrator to install it.'), ts('Missing mbstring Extension'), - \Psr\Log\LogLevel::ERROR, + \Psr\Log\LogLevel::WARNING, 'fa-server' ); } diff --git a/templates/CRM/Dashlet/Page/Blog.tpl b/templates/CRM/Dashlet/Page/Blog.tpl index 6d4f8a93c8b6..eee9b94da56d 100644 --- a/templates/CRM/Dashlet/Page/Blog.tpl +++ b/templates/CRM/Dashlet/Page/Blog.tpl @@ -61,7 +61,7 @@