From 275ef147f63e885cef28569b237ad885b567910a Mon Sep 17 00:00:00 2001 From: mrgoldy Date: Wed, 8 Apr 2020 22:19:40 +0200 Subject: [PATCH] [ticket/16422] Strip BOM characters PHPBB3-16422 --- phpBB/phpbb/request/type_cast_helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/phpbb/request/type_cast_helper.php b/phpBB/phpbb/request/type_cast_helper.php index 912494998d..d49b389521 100644 --- a/phpBB/phpbb/request/type_cast_helper.php +++ b/phpBB/phpbb/request/type_cast_helper.php @@ -36,7 +36,7 @@ class type_cast_helper implements \phpbb\request\type_cast_helper_interface if ($type == 'string') { - $result = str_replace(array("\r\n", "\r", "\0"), array("\n", "\n", ''), $result); + $result = strtr($result, ["\r\n" => "\n", "\r" => "\n", "\0" => '', "\u{FEFF}" => '']); if ($trim) {