From: Coleman Watts Date: Fri, 31 Jan 2020 16:40:26 +0000 (-0500) Subject: Use built-in php function to do what we were trying to do with str_replace X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=4a439e7a503d170bf0414bea59c09a2a53f999b7;p=civicrm-core.git Use built-in php function to do what we were trying to do with str_replace --- diff --git a/ext/afform/core/CRM/Afform/ArrayHtml.php b/ext/afform/core/CRM/Afform/ArrayHtml.php index 84a4ae15d4..464363f5bf 100644 --- a/ext/afform/core/CRM/Afform/ArrayHtml.php +++ b/ext/afform/core/CRM/Afform/ArrayHtml.php @@ -365,11 +365,7 @@ class CRM_Afform_ArrayHtml { * @return string */ public function replaceUnicodeChars($markup) { - // TODO: Potentially replace other unicode characters that can be represented as html entities - $replace = [ - ["\xc2\xa0", ' '], - ]; - return str_replace(array_column($replace, 0), array_column($replace, 1), $markup); + return mb_convert_encoding($markup, 'HTML-ENTITIES', 'UTF-8'); } /**