From a1e8282e672e0cddd2239c1ece30cf6eb96a09eb Mon Sep 17 00:00:00 2001 From: oxcom Date: Mon, 2 Sep 2019 14:31:07 +0200 Subject: [ticket/16146] New core event: after move forum PHPBB3-16146 --- phpBB/includes/acp/acp_forums.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'phpBB/includes/acp/acp_forums.php') diff --git a/phpBB/includes/acp/acp_forums.php b/phpBB/includes/acp/acp_forums.php index cb0593b14a..03c178f968 100644 --- a/phpBB/includes/acp/acp_forums.php +++ b/phpBB/includes/acp/acp_forums.php @@ -1576,6 +1576,19 @@ class acp_forums $db->sql_query($sql); } + /** + * Event when content has been moved from one forum to another + * + * @event core.acp_manage_forums_move_content + * @var int from_id If of the current parent forum + * @var int to_id If of the new parent forum + * @var bool sync Shall we sync the "to"-forum's data + * + * @since 3.2.9-RC1 + */ + $vars = array('from_id', 'to_id', 'sync'); + extract($phpbb_dispatcher->trigger_event('core.acp_manage_forums_move_content_after', compact($vars))); + if ($sync) { // Delete ghost topics that link back to the same forum then resync counters -- cgit v1.2.1 From 776a7302a4daf88ce760e89c6f9617482c0ae5e5 Mon Sep 17 00:00:00 2001 From: oxcom Date: Tue, 3 Sep 2019 08:15:00 +0200 Subject: [ticket/16146] fix event name in comment PHPBB3-16146 --- phpBB/includes/acp/acp_forums.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/includes/acp/acp_forums.php') diff --git a/phpBB/includes/acp/acp_forums.php b/phpBB/includes/acp/acp_forums.php index 03c178f968..25545e9265 100644 --- a/phpBB/includes/acp/acp_forums.php +++ b/phpBB/includes/acp/acp_forums.php @@ -1579,7 +1579,7 @@ class acp_forums /** * Event when content has been moved from one forum to another * - * @event core.acp_manage_forums_move_content + * @event core.acp_manage_forums_move_content_after * @var int from_id If of the current parent forum * @var int to_id If of the new parent forum * @var bool sync Shall we sync the "to"-forum's data -- cgit v1.2.1 From 6600fc6cad5f6d43acdcc9a303be4ce91ed48f2e Mon Sep 17 00:00:00 2001 From: 3D-I <480857+3D-I@users.noreply.github.com> Date: Sun, 8 Sep 2019 03:29:27 +0200 Subject: [ticket/16151] Enable Emojis and rich text in forum name PHPBB3-16151 --- phpBB/includes/acp/acp_forums.php | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'phpBB/includes/acp/acp_forums.php') diff --git a/phpBB/includes/acp/acp_forums.php b/phpBB/includes/acp/acp_forums.php index cb0593b14a..0bbaf96dec 100644 --- a/phpBB/includes/acp/acp_forums.php +++ b/phpBB/includes/acp/acp_forums.php @@ -986,10 +986,30 @@ class acp_forums $errors[] = $user->lang['FORUM_NAME_EMPTY']; } - // No Emojis + /** + * Replace Emojis and other 4bit UTF-8 chars not allowed by MySql to NCR. + * Using their Numeric Character Reference's Hexadecimal notation. + * Doesn't interfere with Japanese or Cyrillic etc. + * + * @see https://www.w3.org/TR/xml11/ + * @see https://www.opentag.com/xfaq_charrep.htm + */ + if (preg_match_all('/[\x{10000}-\x{10FFFF}]/u', $forum_data_ary['forum_name'], $matches)) + { + foreach ($matches as $key => $emoji) + { + $forum_data_ary['forum_name'] = str_replace($emoji, utf8_encode_ncr($emoji), $forum_data_ary['forum_name']); + } + } + + /** + * This should never happen again. + * Leaving the fallback hre just in case there will be the need of it. + */ if (preg_match_all('/[\x{10000}-\x{10FFFF}]/u', $forum_data_ary['forum_name'], $matches)) { $character_list = implode('
', $matches[0]); + $errors[] = $user->lang('FORUM_NAME_EMOJI', $character_list); } -- cgit v1.2.1 From 4e816b58c6fdc6351f44f0d50b0ea5db52278245 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sat, 26 Oct 2019 21:23:47 +0200 Subject: [ticket/16146] Fix typos in event description PHPBB3-16146 --- phpBB/includes/acp/acp_forums.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'phpBB/includes/acp/acp_forums.php') diff --git a/phpBB/includes/acp/acp_forums.php b/phpBB/includes/acp/acp_forums.php index 25545e9265..668f2f8ebd 100644 --- a/phpBB/includes/acp/acp_forums.php +++ b/phpBB/includes/acp/acp_forums.php @@ -1423,8 +1423,8 @@ class acp_forums * This event may be triggered, when a forum is deleted * * @event core.acp_manage_forums_move_children - * @var int from_id If of the current parent forum - * @var int to_id If of the new parent forum + * @var int from_id Id of the current parent forum + * @var int to_id Id of the new parent forum * @var array errors Array of errors, should be strings and not * language key. * @since 3.1.0-a1 @@ -1529,8 +1529,8 @@ class acp_forums * Event when we move content from one forum to another * * @event core.acp_manage_forums_move_content - * @var int from_id If of the current parent forum - * @var int to_id If of the new parent forum + * @var int from_id Id of the current parent forum + * @var int to_id Id of the new parent forum * @var bool sync Shall we sync the "to"-forum's data * @var array errors Array of errors, should be strings and not * language key. If this array is not empty, @@ -1580,8 +1580,8 @@ class acp_forums * Event when content has been moved from one forum to another * * @event core.acp_manage_forums_move_content_after - * @var int from_id If of the current parent forum - * @var int to_id If of the new parent forum + * @var int from_id Id of the current parent forum + * @var int to_id Id of the new parent forum * @var bool sync Shall we sync the "to"-forum's data * * @since 3.2.9-RC1 -- cgit v1.2.1 From 2cdc2e751eb03b6ba6c34889dc3db2a301b8c326 Mon Sep 17 00:00:00 2001 From: 3D-I <480857+3D-I@users.noreply.github.com> Date: Mon, 28 Oct 2019 02:34:59 +0100 Subject: [ticket/16151] Enable Emojis and rich text in forum name Move to a new function() PHPBB3-16151 --- phpBB/includes/acp/acp_forums.php | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) (limited to 'phpBB/includes/acp/acp_forums.php') diff --git a/phpBB/includes/acp/acp_forums.php b/phpBB/includes/acp/acp_forums.php index 0bbaf96dec..d31404fa22 100644 --- a/phpBB/includes/acp/acp_forums.php +++ b/phpBB/includes/acp/acp_forums.php @@ -987,24 +987,14 @@ class acp_forums } /** - * Replace Emojis and other 4bit UTF-8 chars not allowed by MySql to NCR. + * Replace Emojis and other 4bit UTF-8 chars not allowed by MySql to UCR / NCR. * Using their Numeric Character Reference's Hexadecimal notation. - * Doesn't interfere with Japanese or Cyrillic etc. - * - * @see https://www.w3.org/TR/xml11/ - * @see https://www.opentag.com/xfaq_charrep.htm */ - if (preg_match_all('/[\x{10000}-\x{10FFFF}]/u', $forum_data_ary['forum_name'], $matches)) - { - foreach ($matches as $key => $emoji) - { - $forum_data_ary['forum_name'] = str_replace($emoji, utf8_encode_ncr($emoji), $forum_data_ary['forum_name']); - } - } + $forum_data_ary['forum_name'] = utf8_encode_ucr($forum_data_ary['forum_name']); /** * This should never happen again. - * Leaving the fallback hre just in case there will be the need of it. + * Leaving the fallback here just in case there will be the need of it. */ if (preg_match_all('/[\x{10000}-\x{10FFFF}]/u', $forum_data_ary['forum_name'], $matches)) { -- cgit v1.2.1