From 513e62f61d8ac65e9bf29c7ce10835ea56d9e616 Mon Sep 17 00:00:00 2001 From: rxu Date: Wed, 20 Jan 2021 23:26:29 +0700 Subject: [PATCH] [ticket/16690] Fix html functions default flag in convertor PHPBB3-16690 --- phpBB/install/convert/convertor.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/phpBB/install/convert/convertor.php b/phpBB/install/convert/convertor.php index 70efcaa253..b40b53cdb5 100644 --- a/phpBB/install/convert/convertor.php +++ b/phpBB/install/convert/convertor.php @@ -1468,6 +1468,12 @@ class convertor $value = array($value); } + // Add ENT_COMPAT default flag to html specialchars/entities functions, see PHPBB3-16690 + if (in_array($execution, ['htmlspecialchars', 'htmlentities', 'htmlspecialchars_decode', 'html_entitity_decode'])) + { + $value[] = ENT_COMPAT; + } + $value = call_user_func_array($execution, $value); } else if (strpos($type, 'execute') === 0) @@ -1517,6 +1523,12 @@ class convertor $value = array($value); } + // Add ENT_COMPAT default flag to html specialchars/entities functions, see PHPBB3-16690 + if (in_array($execution, ['htmlspecialchars', 'htmlentities', 'htmlspecialchars_decode', 'html_entitity_decode'])) + { + $value[] = ENT_COMPAT; + } + $value = call_user_func_array($execution, $value); } else if (strpos($type, 'execute') === 0)