From 17f4dce0fc2bb1105a3181ccd7a4119f40191c2b Mon Sep 17 00:00:00 2001 From: rxu Date: Sun, 11 Jan 2015 20:36:22 +0700 Subject: [PATCH] [ticket/13492] Add IDN support for custom BBCode URL tokens Custom BBCode URL tokens does not support IDN. Custom BBCodes added earlier than IDN has been applied are unaffected. PHPBB3-13492 --- phpBB/includes/acp/acp_bbcodes.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/phpBB/includes/acp/acp_bbcodes.php b/phpBB/includes/acp/acp_bbcodes.php index 130a3ef542..2686be64e0 100644 --- a/phpBB/includes/acp/acp_bbcodes.php +++ b/phpBB/includes/acp/acp_bbcodes.php @@ -409,7 +409,9 @@ class acp_bbcodes { $bbcode_match = trim($bbcode_match); $bbcode_tpl = trim($bbcode_tpl); - $utf8 = strpos($bbcode_match, 'INTTEXT') !== false; + + // Allow unicode characters for URL|LOCAL_URL|RELATIVE_URL|INTTEXT tokens + $utf8 = preg_match('/\{(URL|LOCAL_URL|RELATIVE_URL|INTTEXT)\}/', $bbcode_match); $utf8_pcre_properties = phpbb_pcre_utf8_support();