From 12fdfe145af65b26b42a6a9a18134f748264e04d Mon Sep 17 00:00:00 2001 From: MikelAlejoBR Date: Sun, 22 Jul 2018 17:08:35 +0200 Subject: [ticket/15622] Fix quoting in PMs when BBCodes are disabled Before parsing the private message to be loaded a simple BBCode status check is done to verify that BBCodes are enabled. Depending on that option the quote will be formated as BBCode or as plain text, similarly to what is done in posting.php. PHPBB3-15622 --- phpBB/includes/ucp/ucp_pm_compose.php | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'phpBB/includes') diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php index bf18e76568..e108356584 100644 --- a/phpBB/includes/ucp/ucp_pm_compose.php +++ b/phpBB/includes/ucp/ucp_pm_compose.php @@ -978,7 +978,26 @@ function compose_pm($id, $mode, $action, $user_folders = array()) censor_text($message_parser->message), $quote_attributes ); - $message_parser->message = $message_link . $quote_text . "\n\n"; + if ($bbcode_status) + { + $message_parser->message = $message_link . $quote_text . "\n\n"; + } + else + { + $offset = 0; + $quote_string = "> "; + $message = censor_text(trim($message_parser->message)); + // see if we are nesting. It's easily tricked but should work for one level of nesting + if (strpos($message, ">") !== false) + { + $offset = 10; + } + $message = utf8_wordwrap($message, 75 + $offset, "\n"); + + $message = $quote_string . $message; + $message = str_replace("\n", "\n" . $quote_string, $message); + $message_parser->message = $quote_username . " " . $user->lang['WROTE'] . ":\n" . $message . "\n"; + } } if (($action == 'reply' || $action == 'quote' || $action == 'quotepost') && !$preview && !$refresh) -- cgit v1.2.1 From 184d24bb166b754b571bd7ef49b7cfacf1c8381d Mon Sep 17 00:00:00 2001 From: MikelAlejoBR Date: Tue, 31 Jul 2018 16:06:49 +0200 Subject: [ticket/15622] Extract duplicated code PHPBB3-15622 --- phpBB/includes/functions_content.php | 52 +++++++++++++++++++++++++++++++++++ phpBB/includes/ucp/ucp_pm_compose.php | 24 +--------------- 2 files changed, 53 insertions(+), 23 deletions(-) (limited to 'phpBB/includes') diff --git a/phpBB/includes/functions_content.php b/phpBB/includes/functions_content.php index 40d44cfe7b..aee90aab99 100644 --- a/phpBB/includes/functions_content.php +++ b/phpBB/includes/functions_content.php @@ -1758,3 +1758,55 @@ class bitfield $this->data = $this->data | $bitfield->get_blob(); } } + +/** + * Formats the quote according to the given BBCode status setting + * + * @param bool $bbcode_status The status of the BBCode setting + * @param array $quote_attributes The attributes of the quoted post + * @param phpbb\textformatter\utils $text_formatter_utils Text formatter utilities + * @param parse_message $message_parser Message parser class + * @param string $message_link Link of the original quoted post + * @since 3.2.4-RC1 + */ +function format_quote($bbcode_status, $quote_attributes, $text_formatter_utils, $message_parser, $message_link = '') +{ + if ($bbcode_status) + { + $quote_text = $text_formatter_utils->generate_quote( + censor_text($message_parser->message), + $quote_attributes + ); + + if($message_link) + { + $message_parser->message = $message_link . $quote_text . "\n\n"; + } + else + { + $message_parser->message = $quote_text . "\n\n"; + } + } + else + { + $offset = 0; + $quote_string = "> "; + $message = censor_text(trim($message_parser->message)); + // see if we are nesting. It's easily tricked but should work for one level of nesting + if (strpos($message, ">") !== false) + { + $offset = 10; + } + $message = utf8_wordwrap($message, 75 + $offset, "\n"); + + $message = $quote_string . $message; + $message = str_replace("\n", "\n" . $quote_string, $message); + + $message_parser->message = $quote_attributes['author'] . " " . $user->lang['WROTE'] . ":\n" . $message . "\n"; + + if($message_link) + { + $message_parser->message = $message_link . $message_parser->message; + } + } +} diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php index e108356584..48bb9bf21f 100644 --- a/phpBB/includes/ucp/ucp_pm_compose.php +++ b/phpBB/includes/ucp/ucp_pm_compose.php @@ -974,30 +974,8 @@ function compose_pm($id, $mode, $action, $user_folders = array()) { $quote_attributes['post_id'] = $post['msg_id']; } - $quote_text = $phpbb_container->get('text_formatter.utils')->generate_quote( - censor_text($message_parser->message), - $quote_attributes - ); - if ($bbcode_status) - { - $message_parser->message = $message_link . $quote_text . "\n\n"; - } - else - { - $offset = 0; - $quote_string = "> "; - $message = censor_text(trim($message_parser->message)); - // see if we are nesting. It's easily tricked but should work for one level of nesting - if (strpos($message, ">") !== false) - { - $offset = 10; - } - $message = utf8_wordwrap($message, 75 + $offset, "\n"); - $message = $quote_string . $message; - $message = str_replace("\n", "\n" . $quote_string, $message); - $message_parser->message = $quote_username . " " . $user->lang['WROTE'] . ":\n" . $message . "\n"; - } + format_quote($bbcode_status, $quote_attributes, $phpbb_container->get('text_formatter.utils'), $message_parser, $message_link); } if (($action == 'reply' || $action == 'quote' || $action == 'quotepost') && !$preview && !$refresh) -- cgit v1.2.1 From ce2196517bec7dd05f85e7253cb124c0f6d92581 Mon Sep 17 00:00:00 2001 From: MikelAlejoBR Date: Wed, 1 Aug 2018 15:26:14 +0200 Subject: [ticket/15622] Fix message link generation Now the message link is generated in different formats depending on whether BBCodes are allowed or not in the site. PHPBB3-15622 --- phpBB/includes/ucp/ucp_pm_compose.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'phpBB/includes') diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php index 48bb9bf21f..d201c5fe73 100644 --- a/phpBB/includes/ucp/ucp_pm_compose.php +++ b/phpBB/includes/ucp/ucp_pm_compose.php @@ -954,7 +954,16 @@ function compose_pm($id, $mode, $action, $user_folders = array()) $post_id = $request->variable('p', 0); if ($config['allow_post_links']) { - $message_link = "[url=" . generate_board_url() . "/viewtopic.$phpEx?p={$post_id}#p{$post_id}]{$user->lang['SUBJECT']}{$user->lang['COLON']} {$message_subject}[/url]\n\n"; + $message_link = generate_board_url() . "/viewtopic.$phpEx?p={$post_id}#p{$post_id}"; + $message_link_subject = "{$user->lang['SUBJECT']}{$user->lang['COLON']} {$message_subject}"; + if ($bbcode_status) + { + $message_link = "[url=" . $message_link . "]" . $message_link_subject . "[/url]\n\n"; + } + else + { + $message_link = $message_link . " - " . $message_link_subject . "\n\n"; + } } else { -- cgit v1.2.1 From 521aec5923874f8757592a07e09357b323460b00 Mon Sep 17 00:00:00 2001 From: MikelAlejoBR Date: Wed, 1 Aug 2018 17:37:21 +0200 Subject: [ticket/15622] Correct code style PHPBB3-15622 --- phpBB/includes/functions_content.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'phpBB/includes') diff --git a/phpBB/includes/functions_content.php b/phpBB/includes/functions_content.php index aee90aab99..1bc217b694 100644 --- a/phpBB/includes/functions_content.php +++ b/phpBB/includes/functions_content.php @@ -1778,7 +1778,7 @@ function format_quote($bbcode_status, $quote_attributes, $text_formatter_utils, $quote_attributes ); - if($message_link) + if ($message_link) { $message_parser->message = $message_link . $quote_text . "\n\n"; } @@ -1804,7 +1804,7 @@ function format_quote($bbcode_status, $quote_attributes, $text_formatter_utils, $message_parser->message = $quote_attributes['author'] . " " . $user->lang['WROTE'] . ":\n" . $message . "\n"; - if($message_link) + if ($message_link) { $message_parser->message = $message_link . $message_parser->message; } -- cgit v1.2.1 From ada8bc9da2790eeb600d61222b23ffdb5f025bf6 Mon Sep 17 00:00:00 2001 From: MikelAlejoBR Date: Wed, 1 Aug 2018 18:01:37 +0200 Subject: [ticket/15622] Refactor message link concatenation PHPBB3-15622 --- phpBB/includes/functions_content.php | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'phpBB/includes') diff --git a/phpBB/includes/functions_content.php b/phpBB/includes/functions_content.php index 1bc217b694..1e80da98d3 100644 --- a/phpBB/includes/functions_content.php +++ b/phpBB/includes/functions_content.php @@ -1778,14 +1778,7 @@ function format_quote($bbcode_status, $quote_attributes, $text_formatter_utils, $quote_attributes ); - if ($message_link) - { - $message_parser->message = $message_link . $quote_text . "\n\n"; - } - else - { - $message_parser->message = $quote_text . "\n\n"; - } + $message_parser->message = $quote_text . "\n\n"; } else { @@ -1803,10 +1796,10 @@ function format_quote($bbcode_status, $quote_attributes, $text_formatter_utils, $message = str_replace("\n", "\n" . $quote_string, $message); $message_parser->message = $quote_attributes['author'] . " " . $user->lang['WROTE'] . ":\n" . $message . "\n"; + } - if ($message_link) - { - $message_parser->message = $message_link . $message_parser->message; - } + if ($message_link) + { + $message_parser->message = $message_link . $message_parser->message; } } -- cgit v1.2.1 From 9719d5a3d523723b2d471f5b2160171cd7291a43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Calvo?= Date: Thu, 30 Aug 2018 19:05:12 +0200 Subject: [ticket/15762] Update type for forum_topics_per_page in acp_forums PHPBB3-15762 --- phpBB/includes/acp/acp_forums.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/includes') diff --git a/phpBB/includes/acp/acp_forums.php b/phpBB/includes/acp/acp_forums.php index 6b841560c9..13d74f0811 100644 --- a/phpBB/includes/acp/acp_forums.php +++ b/phpBB/includes/acp/acp_forums.php @@ -1012,7 +1012,7 @@ class acp_forums } $range_test_ary = array( - array('lang' => 'FORUM_TOPICS_PAGE', 'value' => $forum_data_ary['forum_topics_per_page'], 'column_type' => 'TINT:0'), + array('lang' => 'FORUM_TOPICS_PAGE', 'value' => $forum_data_ary['forum_topics_per_page'], 'column_type' => 'USINT:0'), ); if (!empty($forum_data_ary['forum_image']) && !file_exists($phpbb_root_path . $forum_data_ary['forum_image'])) -- cgit v1.2.1 From 4a30818e1240d2389bc924045769bb5dab30fe34 Mon Sep 17 00:00:00 2001 From: Jakub Senko Date: Tue, 4 Sep 2018 14:30:19 +0200 Subject: [ticket/15420] Only update quote notification with original author PHPBB3-15420 --- phpBB/includes/functions_posting.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'phpBB/includes') diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 78c66ac6b8..73a2e0be0c 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -2309,8 +2309,14 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll_ary, &$data case 'edit_first_post': case 'edit': case 'edit_last_post': + if ($user->data['user_id'] == $poster_id) + { + $phpbb_notifications->update_notifications(array( + 'notification.type.quote', + ), $notification_data); + } + $phpbb_notifications->update_notifications(array( - 'notification.type.quote', 'notification.type.bookmark', 'notification.type.topic', 'notification.type.post', -- cgit v1.2.1 From 0f10c6ff6f0537c9cb00f6007b6bee9944e6587a Mon Sep 17 00:00:00 2001 From: Jakub Senko Date: Thu, 6 Sep 2018 14:31:57 +0200 Subject: [ticket/15716] Remove OAuth data upon user deletion PHPBB3-15716 --- phpBB/includes/functions_user.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/includes') diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index 245d263720..0e57795eea 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -664,7 +664,7 @@ function user_delete($mode, $user_ids, $retain_username = true) delete_posts('poster_id', $user_ids); } - $table_ary = array(USERS_TABLE, USER_GROUP_TABLE, TOPICS_WATCH_TABLE, FORUMS_WATCH_TABLE, ACL_USERS_TABLE, TOPICS_TRACK_TABLE, TOPICS_POSTED_TABLE, FORUMS_TRACK_TABLE, PROFILE_FIELDS_DATA_TABLE, MODERATOR_CACHE_TABLE, DRAFTS_TABLE, BOOKMARKS_TABLE, SESSIONS_KEYS_TABLE, PRIVMSGS_FOLDER_TABLE, PRIVMSGS_RULES_TABLE); + $table_ary = array(USERS_TABLE, USER_GROUP_TABLE, TOPICS_WATCH_TABLE, FORUMS_WATCH_TABLE, ACL_USERS_TABLE, TOPICS_TRACK_TABLE, TOPICS_POSTED_TABLE, FORUMS_TRACK_TABLE, PROFILE_FIELDS_DATA_TABLE, MODERATOR_CACHE_TABLE, DRAFTS_TABLE, BOOKMARKS_TABLE, SESSIONS_KEYS_TABLE, PRIVMSGS_FOLDER_TABLE, PRIVMSGS_RULES_TABLE, $phpbb_container->getParameter('tables.auth_provider_oauth_token_storage'), $phpbb_container->getParameter('tables.auth_provider_oauth_states'), $phpbb_container->getParameter('tables.auth_provider_oauth_account_assoc')); // Delete the miscellaneous (non-post) data for the user foreach ($table_ary as $table) -- cgit v1.2.1 From 0d7c33c1afd2595ca4f5569af69d1514bec29b35 Mon Sep 17 00:00:00 2001 From: Oliver Schramm Date: Fri, 14 Sep 2018 14:54:20 +0200 Subject: [ticket/15329] Parse drafts before saving them (and decode) PHPBB3-15329 --- phpBB/includes/ucp/ucp_main.php | 24 ++++++++++++++++++++++-- phpBB/includes/ucp/ucp_pm_compose.php | 5 ++++- 2 files changed, 26 insertions(+), 3 deletions(-) (limited to 'phpBB/includes') diff --git a/phpBB/includes/ucp/ucp_main.php b/phpBB/includes/ucp/ucp_main.php index 71a615e75c..cd75eead1e 100644 --- a/phpBB/includes/ucp/ucp_main.php +++ b/phpBB/includes/ucp/ucp_main.php @@ -502,6 +502,9 @@ class ucp_main $draft_subject = $draft_message = ''; add_form_key('ucp_draft'); + include_once($phpbb_root_path . 'includes/message_parser.' . $phpEx); + $message_parser = new parse_message(); + if ($delete) { if (check_form_key('ucp_draft')) @@ -535,9 +538,19 @@ class ucp_main { if ($draft_message && $draft_subject) { + // $auth->acl_gets can't be used here because it will check for global forum permissions in this case + // In general we don't need too harsh checking here for permissions, as this will be handled later when submitting + $bbcode_status = $auth->acl_get('u_pm_bbcode') || $auth->acl_getf_global('f_bbcode'); + $smilies_status = $auth->acl_get('u_pm_smilies') || $auth->acl_getf_global('f_smilies'); + $img_status = $auth->acl_get('u_pm_img') || $auth->acl_getf_global('f_img'); + $flash_status = $auth->acl_get('u_pm_flash') || $auth->acl_getf_global('f_flash'); + + $message_parser->message = $draft_message; + $message_parser->parse($bbcode_status, $config['allow_post_links'], $smilies_status, $img_status, $flash_status, true, $config['allow_post_links']); + $draft_row = array( 'draft_subject' => $draft_subject, - 'draft_message' => $draft_message + 'draft_message' => $message_parser->message, ); $sql = 'UPDATE ' . DRAFTS_TABLE . ' @@ -639,9 +652,16 @@ class ucp_main $insert_url = append_sid("{$phpbb_root_path}ucp.$phpEx", "i=$id&mode=compose&d=" . $draft['draft_id']); } + if (!$submit) + { + $message_parser->message = $draft['draft_message']; + $message_parser->decode_message(); + $draft_message = $message_parser->message; + } + $template_row = array( 'DATE' => $user->format_date($draft['save_time']), - 'DRAFT_MESSAGE' => ($submit) ? $draft_message : $draft['draft_message'], + 'DRAFT_MESSAGE' => $draft_message, 'DRAFT_SUBJECT' => ($submit) ? $draft_subject : $draft['draft_subject'], 'TITLE' => $title, diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php index bf18e76568..bc43b5d1fe 100644 --- a/phpBB/includes/ucp/ucp_pm_compose.php +++ b/phpBB/includes/ucp/ucp_pm_compose.php @@ -659,13 +659,16 @@ function compose_pm($id, $mode, $action, $user_folders = array()) { if (confirm_box(true)) { + $message_parser->message = $message; + $message_parser->parse($bbcode_status, $url_status, $smilies_status, $img_status, $flash_status, true, $url_status); + $sql = 'INSERT INTO ' . DRAFTS_TABLE . ' ' . $db->sql_build_array('INSERT', array( 'user_id' => $user->data['user_id'], 'topic_id' => 0, 'forum_id' => 0, 'save_time' => $current_time, 'draft_subject' => $subject, - 'draft_message' => $message + 'draft_message' => $message_parser->message, ) ); $db->sql_query($sql); -- cgit v1.2.1 From 072572381353b4c4a25acae306122ef43914fd72 Mon Sep 17 00:00:00 2001 From: Jakub Senko Date: Mon, 7 May 2018 22:01:23 +0200 Subject: [ticket/15662] Add template PHPBB3-15662 --- phpBB/includes/functions_messenger.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'phpBB/includes') diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php index a85a3b67c5..fdd1dc6e32 100644 --- a/phpBB/includes/functions_messenger.php +++ b/phpBB/includes/functions_messenger.php @@ -327,6 +327,7 @@ class messenger $subject = $this->subject; $message = $this->msg; + $template = $this->template; /** * Event to modify notification message text before parsing * @@ -336,13 +337,16 @@ class messenger * and the message without sending it * @var string subject The message subject * @var string message The message text + * @var \phpbb\template\template template Template object * @since 3.1.11-RC1 + * @changed 3.2.4-RC1 Added template */ $vars = array( 'method', 'break', 'subject', 'message', + 'template', ); extract($phpbb_dispatcher->trigger_event('core.modify_notification_message', compact($vars))); $this->subject = $subject; -- cgit v1.2.1 From 1a284ebe8dc3cb7559cb374e17bec5a99168ed49 Mon Sep 17 00:00:00 2001 From: Jakub Senko Date: Tue, 6 Mar 2018 18:28:14 +0100 Subject: [ticket/15579] Add ucp_front events PHPBB3-15579 --- phpBB/includes/ucp/ucp_main.php | 42 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 40 insertions(+), 2 deletions(-) (limited to 'phpBB/includes') diff --git a/phpBB/includes/ucp/ucp_main.php b/phpBB/includes/ucp/ucp_main.php index 8584a9a0fd..4fe0c38afb 100644 --- a/phpBB/includes/ucp/ucp_main.php +++ b/phpBB/includes/ucp/ucp_main.php @@ -77,6 +77,22 @@ class ucp_main // If the user can't see any forums, he can't read any posts because fid of 0 is invalid if (!empty($forum_ary)) { + /** + * Modify sql variables before query is processed + * + * @event core.ucp_main_front_modify_sql + * @var string sql_select SQL select + * @var string sql_from SQL from + * @var array forum_ary Forum array + * @since 3.2.4-RC1 + */ + $vars = array( + 'sql_select', + 'sql_from', + 'forum_ary', + ); + extract($phpbb_dispatcher->trigger_event('core.ucp_main_front_modify_sql', compact($vars))); + $sql = "SELECT t.* $sql_select FROM $sql_from WHERE t.topic_type = " . POST_GLOBAL . ' @@ -144,7 +160,7 @@ class ucp_main $folder_img .= '_mine'; } - $template->assign_block_vars('topicrow', array( + $topicrow = array( 'FORUM_ID' => $forum_id, 'TOPIC_ID' => $topic_id, 'TOPIC_AUTHOR' => get_username_string('username', $row['topic_poster'], $row['topic_first_poster_name'], $row['topic_first_poster_colour']), @@ -171,8 +187,30 @@ class ucp_main 'U_LAST_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id&p=" . $row['topic_last_post_id']) . '#p' . $row['topic_last_post_id'], 'U_LAST_POST_AUTHOR' => get_username_string('profile', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']), 'U_NEWEST_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id&view=unread") . '#unread', - 'U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id")) + 'U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id"), ); + + /** + * Add template variables to a front topics row. + * + * @event core.ucp_main_front_modify_template_vars + * @var array topicrow Array containing the template variables for the row + * @var array row Array containing the subscribed forum row data + * @var int forum_id Forum ID + * @var string folder_img Folder image + * @var string folder_alt Alt text for the folder image + * @since 3.2.4-RC1 + */ + $vars = array( + 'topicrow', + 'row', + 'forum_id', + 'folder_img', + 'folder_alt', + ); + extract($phpbb_dispatcher->trigger_event('core.ucp_main_front_modify_template_vars', compact($vars))); + + $template->assign_block_vars('topicrow', $topicrow); } if ($config['load_user_activity']) -- cgit v1.2.1 From e17f00fb6b482c71f3ed42786b6f413373a61b9b Mon Sep 17 00:00:00 2001 From: MikelAlejoBR Date: Sun, 16 Sep 2018 18:59:35 +0200 Subject: [ticket/15622] Remove "since" tag as it belongs to events PHPBB3-15622 --- phpBB/includes/functions_content.php | 1 - 1 file changed, 1 deletion(-) (limited to 'phpBB/includes') diff --git a/phpBB/includes/functions_content.php b/phpBB/includes/functions_content.php index 1e80da98d3..ed35f5213f 100644 --- a/phpBB/includes/functions_content.php +++ b/phpBB/includes/functions_content.php @@ -1767,7 +1767,6 @@ class bitfield * @param phpbb\textformatter\utils $text_formatter_utils Text formatter utilities * @param parse_message $message_parser Message parser class * @param string $message_link Link of the original quoted post - * @since 3.2.4-RC1 */ function format_quote($bbcode_status, $quote_attributes, $text_formatter_utils, $message_parser, $message_link = '') { -- cgit v1.2.1 From 4396bfba65b0c69023b47b564f789700f892e05a Mon Sep 17 00:00:00 2001 From: MikelAlejoBR Date: Sun, 16 Sep 2018 19:00:51 +0200 Subject: [ticket/15622] Rename function to avoid potential future conflicts PHPBB3-15622 --- phpBB/includes/functions_content.php | 2 +- phpBB/includes/ucp/ucp_pm_compose.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'phpBB/includes') diff --git a/phpBB/includes/functions_content.php b/phpBB/includes/functions_content.php index ed35f5213f..e124bd46e6 100644 --- a/phpBB/includes/functions_content.php +++ b/phpBB/includes/functions_content.php @@ -1768,7 +1768,7 @@ class bitfield * @param parse_message $message_parser Message parser class * @param string $message_link Link of the original quoted post */ -function format_quote($bbcode_status, $quote_attributes, $text_formatter_utils, $message_parser, $message_link = '') +function phpbb_format_quote($bbcode_status, $quote_attributes, $text_formatter_utils, $message_parser, $message_link = '') { if ($bbcode_status) { diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php index d201c5fe73..ca2d3257e6 100644 --- a/phpBB/includes/ucp/ucp_pm_compose.php +++ b/phpBB/includes/ucp/ucp_pm_compose.php @@ -984,7 +984,7 @@ function compose_pm($id, $mode, $action, $user_folders = array()) $quote_attributes['post_id'] = $post['msg_id']; } - format_quote($bbcode_status, $quote_attributes, $phpbb_container->get('text_formatter.utils'), $message_parser, $message_link); + phpbb_format_quote($bbcode_status, $quote_attributes, $phpbb_container->get('text_formatter.utils'), $message_parser, $message_link); } if (($action == 'reply' || $action == 'quote' || $action == 'quotepost') && !$preview && !$refresh) -- cgit v1.2.1 From 78732fd7c25513a30d460710a3a5919aef75bfdf Mon Sep 17 00:00:00 2001 From: kinerity Date: Sat, 22 Sep 2018 21:16:53 -0400 Subject: [ticket/15803] Add events on ucp_pm_compose for additional message list actions Event added for the handle_message_list_actions() function in ucp_pm_compose so that extensions can perform additional actions. PHPBB3-15803 --- phpBB/includes/ucp/ucp_pm_compose.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'phpBB/includes') diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php index f35812b90a..bb3eed5596 100644 --- a/phpBB/includes/ucp/ucp_pm_compose.php +++ b/phpBB/includes/ucp/ucp_pm_compose.php @@ -1437,6 +1437,21 @@ function handle_message_list_actions(&$address_list, &$error, $remove_u, $remove $error[] = $user->lang['PM_USERS_REMOVED_NO_PERMISSION']; } } + + /** + * Event for additional message list actions + * + * @event core.message_list_actions + * @var array address_list The assoc array with the recipient user/group ids + * @var array error The array containing error data + * @var object remove_u The variable for removing a user + * @var object remove_g The variable for removing a group + * @var object add_to The variable for adding a user to the [TO] field + * @var object add_bcc The variable for adding a user to the [BCC] field + * @since 3.1.7-RC1 + */ + $vars = array('address_list', 'error', 'remove_u', 'remove_g', 'add_to', 'add_bcc'); + extract($phpbb_dispatcher->trigger_event('core.message_list_actions', compact($vars))); } /** -- cgit v1.2.1 From 8ed759545e6f272ce7236b25e7cd34301455fdeb Mon Sep 17 00:00:00 2001 From: kinerity Date: Sat, 22 Sep 2018 21:30:55 -0400 Subject: [ticket/15803] Fix since version PHPBB3-15803 --- phpBB/includes/ucp/ucp_pm_compose.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/includes') diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php index bb3eed5596..0dfe6e813c 100644 --- a/phpBB/includes/ucp/ucp_pm_compose.php +++ b/phpBB/includes/ucp/ucp_pm_compose.php @@ -1448,7 +1448,7 @@ function handle_message_list_actions(&$address_list, &$error, $remove_u, $remove * @var object remove_g The variable for removing a group * @var object add_to The variable for adding a user to the [TO] field * @var object add_bcc The variable for adding a user to the [BCC] field - * @since 3.1.7-RC1 + * @since 3.2.4-RC1 */ $vars = array('address_list', 'error', 'remove_u', 'remove_g', 'add_to', 'add_bcc'); extract($phpbb_dispatcher->trigger_event('core.message_list_actions', compact($vars))); -- cgit v1.2.1 From eb867fc62311970118d9c340c16073dbc01805b0 Mon Sep 17 00:00:00 2001 From: kinerity Date: Sat, 22 Sep 2018 23:04:18 -0400 Subject: [ticket/15803] Global $phpbb_dispatcher PHPBB3-15803 --- phpBB/includes/ucp/ucp_pm_compose.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/includes') diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php index 0dfe6e813c..eeb77c3973 100644 --- a/phpBB/includes/ucp/ucp_pm_compose.php +++ b/phpBB/includes/ucp/ucp_pm_compose.php @@ -1260,7 +1260,7 @@ function compose_pm($id, $mode, $action, $user_folders = array()) function handle_message_list_actions(&$address_list, &$error, $remove_u, $remove_g, $add_to, $add_bcc) { global $auth, $db, $user; - global $request; + global $request, $phpbb_dispatcher; // Delete User [TO/BCC] if ($remove_u && $request->variable('remove_u', array(0 => ''))) -- cgit v1.2.1 From 1d0fdc446f4642584a58eb23d8510ec73caa475a Mon Sep 17 00:00:00 2001 From: Jakub Senko Date: Mon, 24 Sep 2018 16:09:28 +0200 Subject: [ticket/15805] Add result to core.login_box_redirect PHPBB3-15805 --- phpBB/includes/functions.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'phpBB/includes') diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index cbea7afe6e..5caa144801 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -2350,10 +2350,12 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa * @event core.login_box_redirect * @var string redirect Redirect string * @var bool admin Is admin? + * @var array result Result from auth provider * @since 3.1.0-RC5 * @changed 3.1.9-RC1 Removed undefined return variable + * @changed 3.2.4-RC1 Added result */ - $vars = array('redirect', 'admin'); + $vars = array('redirect', 'admin', 'result'); extract($phpbb_dispatcher->trigger_event('core.login_box_redirect', compact($vars))); // append/replace SID (may change during the session for AOL users) -- cgit v1.2.1 From 62c9996b2f5848ba9cc7b3211e62d6001e13d061 Mon Sep 17 00:00:00 2001 From: Kailey Truscott Date: Tue, 25 Sep 2018 07:42:55 -0400 Subject: [ticket/15803] Change 'object' to 'bool' PHPBB3-15803 --- phpBB/includes/ucp/ucp_pm_compose.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'phpBB/includes') diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php index eeb77c3973..e168b643ef 100644 --- a/phpBB/includes/ucp/ucp_pm_compose.php +++ b/phpBB/includes/ucp/ucp_pm_compose.php @@ -1444,10 +1444,10 @@ function handle_message_list_actions(&$address_list, &$error, $remove_u, $remove * @event core.message_list_actions * @var array address_list The assoc array with the recipient user/group ids * @var array error The array containing error data - * @var object remove_u The variable for removing a user - * @var object remove_g The variable for removing a group - * @var object add_to The variable for adding a user to the [TO] field - * @var object add_bcc The variable for adding a user to the [BCC] field + * @var bool remove_u The variable for removing a user + * @var bool remove_g The variable for removing a group + * @var bool add_to The variable for adding a user to the [TO] field + * @var bool add_bcc The variable for adding a user to the [BCC] field * @since 3.2.4-RC1 */ $vars = array('address_list', 'error', 'remove_u', 'remove_g', 'add_to', 'add_bcc'); -- cgit v1.2.1 From f251c26fe639a15f729e54c7c15cc5daff29b732 Mon Sep 17 00:00:00 2001 From: Jakub Senko Date: Tue, 25 Sep 2018 15:22:14 +0200 Subject: [ticket/15701] Display signature in MCP PHPBB3-15701 --- phpBB/includes/mcp/mcp_post.php | 5 +++++ phpBB/includes/mcp/mcp_reports.php | 5 +++++ 2 files changed, 10 insertions(+) (limited to 'phpBB/includes') diff --git a/phpBB/includes/mcp/mcp_post.php b/phpBB/includes/mcp/mcp_post.php index d6d0369e48..8d278079fb 100644 --- a/phpBB/includes/mcp/mcp_post.php +++ b/phpBB/includes/mcp/mcp_post.php @@ -213,6 +213,10 @@ function mcp_post_details($id, $mode, $action) $l_deleted_by = ''; } + // parse signature + $parse_flags = ($post_info['user_sig_bbcode_bitfield'] ? OPTION_FLAG_BBCODE : 0) | OPTION_FLAG_SMILIES; + $post_info['user_sig'] = generate_text_for_display($post_info['user_sig'], $post_info['user_sig_bbcode_uid'], $post_info['user_sig_bbcode_bitfield'], $parse_flags, true); + $mcp_post_template_data = array( 'U_MCP_ACTION' => "$url&i=main&quickmod=1&mode=post_details", // Use this for mode paramaters 'U_POST_ACTION' => "$url&i=$id&mode=post_details", // Use this for action parameters @@ -262,6 +266,7 @@ function mcp_post_details($id, $mode, $action) 'POST_IP' => $post_info['poster_ip'], 'POST_IPADDR' => ($auth->acl_get('m_info', $post_info['forum_id']) && $request->variable('lookup', '')) ? @gethostbyaddr($post_info['poster_ip']) : '', 'POST_ID' => $post_info['post_id'], + 'SIGNATURE' => $post_info['user_sig'], 'U_LOOKUP_IP' => ($auth->acl_get('m_info', $post_info['forum_id'])) ? "$url&i=$id&mode=$mode&lookup={$post_info['poster_ip']}#ip" : '', 'U_WHOIS' => ($auth->acl_get('m_info', $post_info['forum_id'])) ? append_sid("{$phpbb_root_path}mcp.$phpEx", "i=$id&mode=$mode&action=whois&p=$post_id&ip={$post_info['poster_ip']}") : '', diff --git a/phpBB/includes/mcp/mcp_reports.php b/phpBB/includes/mcp/mcp_reports.php index f5147deb49..78f497c275 100644 --- a/phpBB/includes/mcp/mcp_reports.php +++ b/phpBB/includes/mcp/mcp_reports.php @@ -242,6 +242,10 @@ class mcp_reports } } + // parse signature + $parse_flags = ($post_info['user_sig_bbcode_bitfield'] ? OPTION_FLAG_BBCODE : 0) | OPTION_FLAG_SMILIES; + $post_info['user_sig'] = generate_text_for_display($post_info['user_sig'], $post_info['user_sig_bbcode_uid'], $post_info['user_sig_bbcode_bitfield'], $parse_flags, true); + $template->assign_vars(array( 'S_MCP_REPORT' => true, 'S_CLOSE_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&mode=report_details&f=' . $post_info['forum_id'] . '&p=' . $post_id), @@ -291,6 +295,7 @@ class mcp_reports 'POST_IP' => $post_info['poster_ip'], 'POST_IPADDR' => ($auth->acl_get('m_info', $post_info['forum_id']) && $request->variable('lookup', '')) ? @gethostbyaddr($post_info['poster_ip']) : '', 'POST_ID' => $post_info['post_id'], + 'SIGNATURE' => $post_info['user_sig'], 'U_LOOKUP_IP' => ($auth->acl_get('m_info', $post_info['forum_id'])) ? $this->u_action . '&r=' . $report_id . '&p=' . $post_id . '&f=' . $forum_id . '&lookup=' . $post_info['poster_ip'] . '#ip' : '', )); -- cgit v1.2.1 From dab4c10c2fe0a2e283ecf5227ef9a253127a1381 Mon Sep 17 00:00:00 2001 From: Jakub Senko Date: Tue, 25 Sep 2018 15:24:34 +0200 Subject: [ticket/15700] Use correct T_THEME_LANG_NAME PHPBB3-15700 --- phpBB/includes/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/includes') diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 1457888c9f..3b0ac17806 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -4506,7 +4506,7 @@ function page_header($page_title = '', $display_online_list = false, $item_id = 'S_COOKIE_NOTICE' => !empty($config['cookie_notice']), 'T_THEME_NAME' => rawurlencode($user->style['style_path']), - 'T_THEME_LANG_NAME' => $user->data['user_lang'], + 'T_THEME_LANG_NAME' => $user->lang_name, 'T_TEMPLATE_NAME' => $user->style['style_path'], 'T_SUPER_TEMPLATE_NAME' => rawurlencode((isset($user->style['style_parent_tree']) && $user->style['style_parent_tree']) ? $user->style['style_parent_tree'] : $user->style['style_path']), 'T_IMAGES' => 'images', -- cgit v1.2.1 From a478063d2b330f8b285fee3b7408a0eb42ec3622 Mon Sep 17 00:00:00 2001 From: Jakub Senko Date: Tue, 25 Sep 2018 15:52:14 +0200 Subject: [ticket/15621] Remove graphical inconsistencies PHPBB3-15621 --- phpBB/includes/ucp/ucp_pm_compose.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'phpBB/includes') diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php index f35812b90a..abdb0baf16 100644 --- a/phpBB/includes/ucp/ucp_pm_compose.php +++ b/phpBB/includes/ucp/ucp_pm_compose.php @@ -124,7 +124,7 @@ function compose_pm($id, $mode, $action, $user_folders = array()) // Add groups to PM box if ($config['allow_mass_pm'] && $auth->acl_get('u_masspm_group')) { - $sql = 'SELECT g.group_id, g.group_name, g.group_type + $sql = 'SELECT g.group_id, g.group_name, g.group_type, g.group_colour FROM ' . GROUPS_TABLE . ' g'; if (!$auth->acl_gets('a_group', 'a_groupadd', 'a_groupdel')) @@ -147,7 +147,7 @@ function compose_pm($id, $mode, $action, $user_folders = array()) $group_options = ''; while ($row = $db->sql_fetchrow($result)) { - $group_options .= '' . $group_helper->get_name($row['group_name']) . ''; + $group_options .= '' . $group_helper->get_name($row['group_name']) . ''; } $db->sql_freeresult($result); } -- cgit v1.2.1 From f82e0a83d1c6ec488f47013d583912f7082406d4 Mon Sep 17 00:00:00 2001 From: Jakub Senko Date: Tue, 25 Sep 2018 16:18:58 +0200 Subject: [ticket/15616] Add jumpbox to login_forum.html PHPBB3-15616 --- phpBB/includes/functions.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'phpBB/includes') diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 1457888c9f..20d24819ec 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -2539,7 +2539,7 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa */ function login_forum_box($forum_data) { - global $db, $phpbb_container, $request, $template, $user, $phpbb_dispatcher; + global $db, $phpbb_container, $request, $template, $user, $phpbb_dispatcher, $phpbb_root_path, $phpEx; $password = $request->variable('password', '', true); @@ -2624,6 +2624,8 @@ function login_forum_box($forum_data) 'body' => 'login_forum.html') ); + make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx"), $forum_data['forum_id']); + page_footer(); } -- cgit v1.2.1 From d29d4389f9efdec4986c62052df7cd8a87135645 Mon Sep 17 00:00:00 2001 From: Jakub Senko Date: Tue, 25 Sep 2018 14:42:03 +0200 Subject: [ticket/15758] Show translated msg for INSECURE_REDIRECT PHPBB3-15758 --- phpBB/includes/functions.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'phpBB/includes') diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 1457888c9f..5351db31f6 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -1744,14 +1744,14 @@ function redirect($url, $return = false, $disable_cd_check = false) if ($url_parts === false) { // Malformed url - trigger_error('INSECURE_REDIRECT', E_USER_ERROR); + trigger_error('INSECURE_REDIRECT', E_USER_WARNING); } else if (!empty($url_parts['scheme']) && !empty($url_parts['host'])) { // Attention: only able to redirect within the same domain if $disable_cd_check is false (yourdomain.com -> www.yourdomain.com will not work) if (!$disable_cd_check && $url_parts['host'] !== $user->host) { - trigger_error('INSECURE_REDIRECT', E_USER_ERROR); + trigger_error('INSECURE_REDIRECT', E_USER_WARNING); } } else if ($url[0] == '/') @@ -1791,13 +1791,13 @@ function redirect($url, $return = false, $disable_cd_check = false) if (!$disable_cd_check && strpos($url, generate_board_url(true) . '/') !== 0) { - trigger_error('INSECURE_REDIRECT', E_USER_ERROR); + trigger_error('INSECURE_REDIRECT', E_USER_WARNING); } // Make sure no linebreaks are there... to prevent http response splitting for PHP < 4.4.2 if (strpos(urldecode($url), "\n") !== false || strpos(urldecode($url), "\r") !== false || strpos($url, ';') !== false) { - trigger_error('INSECURE_REDIRECT', E_USER_ERROR); + trigger_error('INSECURE_REDIRECT', E_USER_WARNING); } // Now, also check the protocol and for a valid url the last time... @@ -1806,7 +1806,7 @@ function redirect($url, $return = false, $disable_cd_check = false) if ($url_parts === false || empty($url_parts['scheme']) || !in_array($url_parts['scheme'], $allowed_protocols)) { - trigger_error('INSECURE_REDIRECT', E_USER_ERROR); + trigger_error('INSECURE_REDIRECT', E_USER_WARNING); } /** -- cgit v1.2.1 From eb4a95f659cdb2dfa5ae00643688d46c6fc30b89 Mon Sep 17 00:00:00 2001 From: Alec Date: Mon, 1 Oct 2018 00:42:55 -0400 Subject: [ticket/15819] Add core event to functions_posting to modify notifications Events added to allow modifying notification data before in the database. Useful to change variables in the notification message, such as usernames. Includes some other residual data to allow this event to be versatile. PHPBB3-15819 --- phpBB/includes/functions_posting.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'phpBB/includes') diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 78c66ac6b8..e28a637286 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -2282,6 +2282,19 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll_ary, &$data 'post_subject' => $subject, )); + /** + * This event allows you to modify the notification data upon submission + * + * @event core.modify_submit_notification_data + * @var array notification_data The notification data to be inserted in to the database + * @var array data_ary The data array with a lot of the post submission data + * @var string mode The posting mode + * @var int poster_id The poster id + * @since 3.2.4-RC1 + */ + $vars = array('notification_data', 'data_ary', 'mode', 'poster_id'); + extract($phpbb_dispatcher->trigger_event('core.modify_submit_notification_data', compact($vars))); + /* @var $phpbb_notifications \phpbb\notification\manager */ $phpbb_notifications = $phpbb_container->get('notification_manager'); -- cgit v1.2.1 From c9df803d3c99ddc513cff85ac7083d25b86e890f Mon Sep 17 00:00:00 2001 From: Jakub Senko Date: Mon, 8 Oct 2018 16:00:06 +0200 Subject: [ticket/15494] Allow user to be removed from NEWLY_REGISTERED multiple times PHPBB3-15494 --- phpBB/includes/functions_user.php | 5 ----- 1 file changed, 5 deletions(-) (limited to 'phpBB/includes') diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index f7be2d2760..50cb140d9b 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -3604,11 +3604,6 @@ function remove_newly_registered($user_id, $user_data = false) } } - if (empty($user_data['user_new'])) - { - return false; - } - $sql = 'SELECT group_id FROM ' . GROUPS_TABLE . " WHERE group_name = 'NEWLY_REGISTERED' -- cgit v1.2.1 From c67dd0c5912844a50323b97e8fecb30d21bb361c Mon Sep 17 00:00:00 2001 From: DSR! Date: Sat, 3 Mar 2018 12:12:38 -0300 Subject: [ticket/15836] Event to send message via external transport PHPBB3-15836 --- phpBB/includes/functions_messenger.php | 83 +++++++++++++++++++++++++++------- 1 file changed, 66 insertions(+), 17 deletions(-) (limited to 'phpBB/includes') diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php index fdd1dc6e32..7b530d7119 100644 --- a/phpBB/includes/functions_messenger.php +++ b/phpBB/includes/functions_messenger.php @@ -521,7 +521,7 @@ class messenger */ function msg_email() { - global $config; + global $config, $phpbb_dispatcher; if (empty($config['email_enable'])) { @@ -549,6 +549,33 @@ class messenger $contact_name = htmlspecialchars_decode($config['board_contact_name']); $board_contact = (($contact_name !== '') ? '"' . mail_encode($contact_name) . '" ' : '') . '<' . $config['board_contact'] . '>'; + $break = false; + $addresses = $this->addresses; + $subject = $this->subject; + $msg = $this->msg; + /** + * Event to send message via external transport + * + * @event core.notification_message_email + * @var bool break Flag indicating if the function return after hook + * @var array addresses The message recipients + * @var string subject The message subject + * @var string msg The message text + * @since 3.2.4-RC1 + */ + $vars = array( + 'break', + 'addresses', + 'subject', + 'msg', + ); + extract($phpbb_dispatcher->trigger_event('core.notification_message_email', compact($vars))); + + if ($break) + { + return true; + } + if (empty($this->replyto)) { $this->replyto = $board_contact; @@ -787,7 +814,7 @@ class queue */ function process() { - global $config, $phpEx, $phpbb_root_path, $user; + global $config, $phpEx, $phpbb_root_path, $user, $phpbb_dispatcher; $lock = new \phpbb\lock\flock($this->cache_file); $lock->acquire(); @@ -884,23 +911,45 @@ class queue switch ($object) { case 'email': - $err_msg = ''; - $to = (!$to) ? 'undisclosed-recipients:;' : $to; - - if ($config['smtp_delivery']) - { - $result = smtpmail($addresses, mail_encode($subject), wordwrap(utf8_wordwrap($msg), 997, "\n", true), $err_msg, $headers); - } - else + $break = false; + /** + * Event to send message via external transport + * + * @event core.notification_message_email + * @var bool break Flag indicating if the function return after hook + * @var array addresses The message recipients + * @var string subject The message subject + * @var string msg The message text + * @since 3.2.4-RC1 + */ + $vars = array( + 'break', + 'addresses', + 'subject', + 'msg', + ); + extract($phpbb_dispatcher->trigger_event('core.notification_message_email', compact($vars))); + + if (!$break) { - $result = phpbb_mail($to, $subject, $msg, $headers, PHP_EOL, $err_msg); - } + $err_msg = ''; + $to = (!$to) ? 'undisclosed-recipients:;' : $to; - if (!$result) - { - $messenger = new messenger(); - $messenger->error('EMAIL', $err_msg); - continue 2; + if ($config['smtp_delivery']) + { + $result = smtpmail($addresses, mail_encode($subject), wordwrap(utf8_wordwrap($msg), 997, "\n", true), $err_msg, $headers); + } + else + { + $result = phpbb_mail($to, $subject, $msg, $headers, PHP_EOL, $err_msg); + } + + if (!$result) + { + $messenger = new messenger(); + $messenger->error('EMAIL', $err_msg); + continue 2; + } } break; -- cgit v1.2.1 From 7263f9bebda27707efa5a9960e8b9c63119f7cc2 Mon Sep 17 00:00:00 2001 From: kasimi Date: Sat, 20 Oct 2018 11:05:04 +0200 Subject: [ticket/15852] Fix whois for IPv6 addresses PHPBB3-15852 --- phpBB/includes/functions_user.php | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'phpBB/includes') diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index 2677916a7d..d019b867fa 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -1429,21 +1429,14 @@ function user_ipwhois($ip) return ''; } - if (preg_match(get_preg_expression('ipv4'), $ip)) - { - // IPv4 address - $whois_host = 'whois.arin.net.'; - } - else if (preg_match(get_preg_expression('ipv6'), $ip)) - { - // IPv6 address - $whois_host = 'whois.sixxs.net.'; - } - else + if (!preg_match(get_preg_expression('ipv4'), $ip) && !preg_match(get_preg_expression('ipv6'), $ip)) { return ''; } + // IPv4 & IPv6 addresses + $whois_host = 'whois.arin.net.'; + $ipwhois = ''; if (($fsk = @fsockopen($whois_host, 43))) -- cgit v1.2.1 From dbd0304c1d659e938d4f311649631e7a6fdb32f6 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Fri, 19 Oct 2018 12:26:37 -0400 Subject: [ticket/15836] Rename event to have unique name PHPBB3-15836 --- phpBB/includes/functions_messenger.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'phpBB/includes') diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php index 7b530d7119..75c15657b0 100644 --- a/phpBB/includes/functions_messenger.php +++ b/phpBB/includes/functions_messenger.php @@ -915,7 +915,7 @@ class queue /** * Event to send message via external transport * - * @event core.notification_message_email + * @event core.notification_message_process * @var bool break Flag indicating if the function return after hook * @var array addresses The message recipients * @var string subject The message subject @@ -928,7 +928,7 @@ class queue 'subject', 'msg', ); - extract($phpbb_dispatcher->trigger_event('core.notification_message_email', compact($vars))); + extract($phpbb_dispatcher->trigger_event('core.notification_message_process', compact($vars))); if (!$break) { -- cgit v1.2.1