From bc5808ad87b51638af739d2abed465321589d7f0 Mon Sep 17 00:00:00 2001 From: Oliver Schramm Date: Sat, 15 Sep 2018 15:44:56 +0200 Subject: [PATCH 01/61] [ticket/15509] Don't show disabled board when in install PHPBB3-15509 --- phpBB/phpbb/user.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/phpbb/user.php b/phpBB/phpbb/user.php index 5899dff2f5..99de680f76 100644 --- a/phpBB/phpbb/user.php +++ b/phpBB/phpbb/user.php @@ -340,7 +340,7 @@ class user extends \phpbb\session } // Is board disabled and user not an admin or moderator? - if ($config['board_disable'] && !defined('IN_LOGIN') && !defined('SKIP_CHECK_DISABLED') && !$auth->acl_gets('a_', 'm_') && !$auth->acl_getf_global('m_')) + if ($config['board_disable'] && !defined('IN_INSTALL') && !defined('IN_LOGIN') && !defined('SKIP_CHECK_DISABLED') && !$auth->acl_gets('a_', 'm_') && !$auth->acl_getf_global('m_')) { if ($this->data['is_bot']) { From eb1cb073412972809a1459aa91d980b4be4ba831 Mon Sep 17 00:00:00 2001 From: Nuno Lopes Date: Sat, 24 Nov 2018 23:43:41 +0000 Subject: [PATCH 02/61] [ticket/15876] MySQL 5.7+ support for Q&A captch plugin PHPBB3-15876 --- phpBB/phpbb/captcha/plugins/qa.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/phpBB/phpbb/captcha/plugins/qa.php b/phpBB/phpbb/captcha/plugins/qa.php index 7797212ac9..af351e89d6 100644 --- a/phpBB/phpbb/captcha/plugins/qa.php +++ b/phpBB/phpbb/captcha/plugins/qa.php @@ -107,8 +107,7 @@ class qa $sql = 'SELECT q.question_id, q.lang_iso FROM ' . $this->table_captcha_questions . ' q, ' . $this->table_captcha_answers . ' a - WHERE q.question_id = a.question_id - GROUP BY lang_iso'; + WHERE q.question_id = a.question_id'; $result = $db->sql_query($sql, 7200); while ($row = $db->sql_fetchrow($result)) From 101829b4dce2874bbe53264c1769bf9699527c2f Mon Sep 17 00:00:00 2001 From: battye Date: Mon, 26 Nov 2018 13:08:57 +0000 Subject: [PATCH 03/61] [ticket/15883] Add error for invalid usernames being added to a group Update the ACP and the UCP so that when bulk adding users to a group, if invalid usernames are submitted alongside valid usernames then a message will be displayed to inform the user what the invalid usernames are. PHPBB3-15883 --- phpBB/includes/acp/acp_groups.php | 14 +++++++++++++- phpBB/includes/functions_user.php | 18 ++++++++++++++++-- phpBB/includes/ucp/ucp_groups.php | 14 +++++++++++++- phpBB/language/en/acp/groups.php | 1 + 4 files changed, 43 insertions(+), 4 deletions(-) diff --git a/phpBB/includes/acp/acp_groups.php b/phpBB/includes/acp/acp_groups.php index 0e058213e0..20f913ff29 100644 --- a/phpBB/includes/acp/acp_groups.php +++ b/phpBB/includes/acp/acp_groups.php @@ -293,7 +293,19 @@ class acp_groups // Add user/s to group if ($error = group_user_add($group_id, false, $name_ary, $group_name, $default, $leader, 0, $group_row)) { - trigger_error($user->lang[$error] . adm_back_link($this->u_action . '&action=list&g=' . $group_id), E_USER_WARNING); + $display_message = $user->lang[$error]; + + if ($error == 'GROUP_USERS_INVALID') + { + // Find which users don't exist + $actual_name_ary = $name_ary; + $actual_user_id_ary = false; + user_get_id_name($actual_user_id_ary, $actual_name_ary, false, true); + + $display_message = sprintf($user->lang['GROUP_USERS_INVALID'], implode($user->lang['COMMA_SEPARATOR'], array_diff($name_ary, $actual_name_ary))); + } + + trigger_error($display_message . adm_back_link($this->u_action . '&action=list&g=' . $group_id), E_USER_WARNING); } $message = ($leader) ? 'GROUP_MODS_ADDED' : 'GROUP_USERS_ADDED'; diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index d019b867fa..e998ffdab9 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -26,8 +26,9 @@ if (!defined('IN_PHPBB')) * @param array &$user_id_ary The user ids to check or empty if usernames used * @param array &$username_ary The usernames to check or empty if user ids used * @param mixed $user_type Array of user types to check, false if not restricting by user type +* @param bool $update_references If false, the supplied array is unset and appears unchanged from where it was called */ -function user_get_id_name(&$user_id_ary, &$username_ary, $user_type = false) +function user_get_id_name(&$user_id_ary, &$username_ary, $user_type = false, $update_references = false) { global $db; @@ -50,7 +51,13 @@ function user_get_id_name(&$user_id_ary, &$username_ary, $user_type = false) } $sql_in = ($which_ary == 'user_id_ary') ? array_map('intval', ${$which_ary}) : array_map('utf8_clean_string', ${$which_ary}); - unset(${$which_ary}); + + // By unsetting the array here, the values passed in at the point user_get_id_name() was called will be retained. + // Otherwise, if we don't unset (as the array was passed by reference) the original array will be updated below. + if ($update_references === false) + { + unset(${$which_ary}); + } $user_id_ary = $username_ary = array(); @@ -2676,6 +2683,13 @@ function group_user_add($group_id, $user_id_ary = false, $username_ary = false, return 'NO_USER'; } + // Because the item that gets passed into the previous function is unset, the reference is lost and our original + // array is retained - so we know there's a problem if there's a different number of ids to usernames now. + if (count($user_id_ary) != count($username_ary)) + { + return 'GROUP_USERS_INVALID'; + } + // Remove users who are already members of this group $sql = 'SELECT user_id, group_leader FROM ' . USER_GROUP_TABLE . ' diff --git a/phpBB/includes/ucp/ucp_groups.php b/phpBB/includes/ucp/ucp_groups.php index 1fb026167a..e32c855179 100644 --- a/phpBB/includes/ucp/ucp_groups.php +++ b/phpBB/includes/ucp/ucp_groups.php @@ -1057,7 +1057,19 @@ class ucp_groups // Add user/s to group if ($error = group_user_add($group_id, false, $name_ary, $group_name, $default, 0, 0, $group_row)) { - trigger_error($user->lang[$error] . $return_page); + $display_message = $user->lang[$error]; + + if ($error == 'GROUP_USERS_INVALID') + { + // Find which users don't exist + $actual_name_ary = $name_ary; + $actual_user_id_ary = false; + user_get_id_name($actual_user_id_ary, $actual_name_ary, false, true); + + $display_message = sprintf($user->lang['GROUP_USERS_INVALID'], implode($user->lang['COMMA_SEPARATOR'], array_diff($name_ary, $actual_name_ary))); + } + + trigger_error($display_message . $return_page); } trigger_error($user->lang['GROUP_USERS_ADDED'] . '

' . sprintf($user->lang['RETURN_PAGE'], '', '')); diff --git a/phpBB/language/en/acp/groups.php b/phpBB/language/en/acp/groups.php index c3a5ae9e44..5d68132a34 100644 --- a/phpBB/language/en/acp/groups.php +++ b/phpBB/language/en/acp/groups.php @@ -111,6 +111,7 @@ $lang = array_merge($lang, array( 'GROUP_USERS_ADDED' => 'New users added to group successfully.', 'GROUP_USERS_EXIST' => 'The selected users are already members.', 'GROUP_USERS_REMOVE' => 'Users removed from group and new defaults set successfully.', + 'GROUP_USERS_INVALID' => 'No users were added to the group as the following usernames do not exist: %s', 'LEGEND_EXPLAIN' => 'These are the groups which are displayed in the group legend:', 'LEGEND_SETTINGS' => 'Legend settings', From c594f2ecbf713a3090fb27a89679678531a1c40f Mon Sep 17 00:00:00 2001 From: 3D-I Date: Tue, 27 Nov 2018 02:25:12 +0100 Subject: [PATCH 04/61] [ticket/15884] Add memberlist_body_* events PHPBB3-15884 --- phpBB/styles/prosilver/template/memberlist_body.html | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/phpBB/styles/prosilver/template/memberlist_body.html b/phpBB/styles/prosilver/template/memberlist_body.html index cedc5031c7..3d24bc7d65 100644 --- a/phpBB/styles/prosilver/template/memberlist_body.html +++ b/phpBB/styles/prosilver/template/memberlist_body.html @@ -60,6 +60,7 @@ {L_COMMA_SEPARATOR} {custom_fields.PROFILE_FIELD_NAME} {L_JOINED} {L_LAST_ACTIVE} + {% EVENT memberlist_body_memberlist_append %} @@ -91,12 +92,14 @@ {% for field in custom_fields %}{% if not loop.first %}{L_COMMA_SEPARATOR} {% endif %}{{ field.PROFILE_FIELD_NAME }}{% endfor %} {L_JOINED} {L_LAST_ACTIVE} + {% EVENT memberlist_body_leaders_set_append %} {L_GROUP_MEMBERS} {L_POSTS} {L_COMMA_SEPARATOR} {custom_fields.PROFILE_FIELD_NAME} {L_JOINED} {L_LAST_ACTIVE} + {% EVENT memberlist_body_show_group_append %} @@ -111,6 +114,7 @@
{memberrow.custom_fields.PROFILE_FIELD_VALUE}
  {memberrow.JOINED} {memberrow.LAST_ACTIVE}  + {% EVENT memberlist_body_memberrow_append %} From 7a92f6a3b63bf4de7cd9f0d4854ef981c7444465 Mon Sep 17 00:00:00 2001 From: 3D-I Date: Tue, 27 Nov 2018 06:52:29 +0100 Subject: [PATCH 05/61] [ticket/15884] Add memberlist_body_* events update events.md PHPBB3-15884 --- phpBB/docs/events.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/phpBB/docs/events.md b/phpBB/docs/events.md index de3952cafc..12239c6e9d 100644 --- a/phpBB/docs/events.md +++ b/phpBB/docs/events.md @@ -1114,6 +1114,27 @@ mcp_warn_user_add_warning_field_before * Since: 3.1.0-RC4 * Purpose: Add content during warning a user - before add warning field. +memberlist_body_memberlist_append +=== +* Locations: + + styles/prosilver/template/memberlist_body.html +* Since: 3.2.5-RC1 +* Purpose: Add data after the last row in the memberlist. + +memberlist_body_leaders_set_append +=== +* Locations: + + styles/prosilver/template/memberlist_body.html +* Since: 3.2.5-RC1 +* Purpose: Add data after the last row in the memberlist mode leaders. + +memberlist_body_show_group_append +=== +* Locations: + + styles/prosilver/template/memberlist_body.html +* Since: 3.2.5-RC1 +* Purpose: Add data after the last row in the memberlist mode group. + memberlist_body_rank_append === * Locations: @@ -1146,6 +1167,13 @@ memberlist_body_username_prepend * Purpose: Add information before every username in the memberlist. Works in all display modes (leader, group and normal memberlist). +memberlist_body_memberrow_append +=== +* Locations: + + styles/prosilver/template/memberlist_body.html +* Since: 3.2.5-RC1 +* Purpose: Add data after the last memberrow in the memberlist. + memberlist_email_before === * Locations: From ad0c85293bf36b5604121cf25ef702bd3507cdd0 Mon Sep 17 00:00:00 2001 From: 3D-I Date: Thu, 29 Nov 2018 01:19:10 +0100 Subject: [PATCH 06/61] [ticket/15884] Add memberlist_body_* events add new events for group update events name update events.md PHPBB3-15884 --- phpBB/docs/events.md | 43 +++++++++++++++++-- .../prosilver/template/memberlist_body.html | 14 ++++-- 2 files changed, 49 insertions(+), 8 deletions(-) diff --git a/phpBB/docs/events.md b/phpBB/docs/events.md index 12239c6e9d..93b675b689 100644 --- a/phpBB/docs/events.md +++ b/phpBB/docs/events.md @@ -1114,21 +1114,56 @@ mcp_warn_user_add_warning_field_before * Since: 3.1.0-RC4 * Purpose: Add content during warning a user - before add warning field. -memberlist_body_memberlist_append +memberlist_body_group_name_before +=== +* Locations: + + styles/prosilver/template/memberlist_body.html +* Since: 3.2.5-RC1 +* Purpose: Add data before the group name in the group profile page. + +memberlist_body_group_name_after +=== +* Locations: + + styles/prosilver/template/memberlist_body.html +* Since: 3.2.5-RC1 +* Purpose: Add data after the group name in the group profile page. + +memberlist_body_group_desc_after +=== +* Locations: + + styles/prosilver/template/memberlist_body.html +* Since: 3.2.5-RC1 +* Purpose: Add data after the the group description in the group profile page. + +memberlist_body_group_rank_before +=== +* Locations: + + styles/prosilver/template/memberlist_body.html +* Since: 3.2.5-RC1 +* Purpose: Add data before the group rank in the group profile page. + +memberlist_body_group_rank_desc +=== +* Locations: + + styles/prosilver/template/memberlist_body.html +* Since: 3.2.5-RC1 +* Purpose: Add data after the group rank in the group profile page. + +memberlist_body_memberlist_after === * Locations: + styles/prosilver/template/memberlist_body.html * Since: 3.2.5-RC1 * Purpose: Add data after the last row in the memberlist. -memberlist_body_leaders_set_append +memberlist_body_leaders_set_after === * Locations: + styles/prosilver/template/memberlist_body.html * Since: 3.2.5-RC1 * Purpose: Add data after the last row in the memberlist mode leaders. -memberlist_body_show_group_append +memberlist_body_show_group_after === * Locations: + styles/prosilver/template/memberlist_body.html @@ -1167,7 +1202,7 @@ memberlist_body_username_prepend * Purpose: Add information before every username in the memberlist. Works in all display modes (leader, group and normal memberlist). -memberlist_body_memberrow_append +memberlist_body_memberrow_after === * Locations: + styles/prosilver/template/memberlist_body.html diff --git a/phpBB/styles/prosilver/template/memberlist_body.html b/phpBB/styles/prosilver/template/memberlist_body.html index 3d24bc7d65..f605766123 100644 --- a/phpBB/styles/prosilver/template/memberlist_body.html +++ b/phpBB/styles/prosilver/template/memberlist_body.html @@ -13,16 +13,22 @@ + {% EVENT memberlist_body_group_name_before %}

style="color:#{GROUP_COLOR};">{GROUP_NAME}

+ {% EVENT memberlist_body_group_name_after %}

{L_MANAGE_GROUP}

{GROUP_DESC} {GROUP_TYPE}

+ {% EVENT memberlist_body_group_desc_after %} +

{AVATAR_IMG} + {% EVENT memberlist_body_group_rank_before %} {RANK_IMG} {GROUP_RANK} + {% EVENT memberlist_body_group_rank_after %}

{PAGE_TITLE}{L_COLON} {SEARCH_WORDS}

@@ -60,7 +66,7 @@ {L_COMMA_SEPARATOR} {custom_fields.PROFILE_FIELD_NAME} {L_JOINED} {L_LAST_ACTIVE} - {% EVENT memberlist_body_memberlist_append %} + {% EVENT memberlist_body_memberlist_after %} @@ -92,14 +98,14 @@ {% for field in custom_fields %}{% if not loop.first %}{L_COMMA_SEPARATOR} {% endif %}{{ field.PROFILE_FIELD_NAME }}{% endfor %} {L_JOINED} {L_LAST_ACTIVE} - {% EVENT memberlist_body_leaders_set_append %} + {% EVENT memberlist_body_leaders_set_after %} {L_GROUP_MEMBERS} {L_POSTS} {L_COMMA_SEPARATOR} {custom_fields.PROFILE_FIELD_NAME} {L_JOINED} {L_LAST_ACTIVE} - {% EVENT memberlist_body_show_group_append %} + {% EVENT memberlist_body_show_group_after %} @@ -114,7 +120,7 @@
{memberrow.custom_fields.PROFILE_FIELD_VALUE}
  {memberrow.JOINED} {memberrow.LAST_ACTIVE}  - {% EVENT memberlist_body_memberrow_append %} + {% EVENT memberlist_body_memberrow_after %} From 1345642c49c1904b4862c156094b6d754f6240e3 Mon Sep 17 00:00:00 2001 From: 3D-I Date: Thu, 29 Nov 2018 01:44:28 +0100 Subject: [PATCH 07/61] [ticket/15884] Add memberlist_body_* events update events name update events.md PHPBB3-15884 --- phpBB/docs/events.md | 4 ++-- phpBB/styles/prosilver/template/memberlist_body.html | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/phpBB/docs/events.md b/phpBB/docs/events.md index 93b675b689..04c22de2f9 100644 --- a/phpBB/docs/events.md +++ b/phpBB/docs/events.md @@ -1142,12 +1142,12 @@ memberlist_body_group_rank_before * Since: 3.2.5-RC1 * Purpose: Add data before the group rank in the group profile page. -memberlist_body_group_rank_desc +memberlist_body_group_rank_desc_after === * Locations: + styles/prosilver/template/memberlist_body.html * Since: 3.2.5-RC1 -* Purpose: Add data after the group rank in the group profile page. +* Purpose: Add data after the group rank desc and type in the group profile page. memberlist_body_memberlist_after === diff --git a/phpBB/styles/prosilver/template/memberlist_body.html b/phpBB/styles/prosilver/template/memberlist_body.html index f605766123..a2784a5ad8 100644 --- a/phpBB/styles/prosilver/template/memberlist_body.html +++ b/phpBB/styles/prosilver/template/memberlist_body.html @@ -21,7 +21,7 @@

{GROUP_DESC} {GROUP_TYPE}

- {% EVENT memberlist_body_group_desc_after %} + {% EVENT memberlist_body_group_rank_desc_after %}

{AVATAR_IMG} From 8ed7ddfbb2a65e44819c2e5e640d0ebe17118445 Mon Sep 17 00:00:00 2001 From: 3D-I Date: Thu, 29 Nov 2018 01:46:55 +0100 Subject: [PATCH 08/61] [ticket/15884] Add memberlist_body_* events update events name update events.md PHPBB3-15884 --- phpBB/docs/events.md | 4 ++-- phpBB/styles/prosilver/template/memberlist_body.html | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/phpBB/docs/events.md b/phpBB/docs/events.md index 04c22de2f9..4fd43eab98 100644 --- a/phpBB/docs/events.md +++ b/phpBB/docs/events.md @@ -1142,12 +1142,12 @@ memberlist_body_group_rank_before * Since: 3.2.5-RC1 * Purpose: Add data before the group rank in the group profile page. -memberlist_body_group_rank_desc_after +memberlist_body_group_desc_after === * Locations: + styles/prosilver/template/memberlist_body.html * Since: 3.2.5-RC1 -* Purpose: Add data after the group rank desc and type in the group profile page. +* Purpose: Add data after the group desc and type in the group profile page. memberlist_body_memberlist_after === diff --git a/phpBB/styles/prosilver/template/memberlist_body.html b/phpBB/styles/prosilver/template/memberlist_body.html index a2784a5ad8..f605766123 100644 --- a/phpBB/styles/prosilver/template/memberlist_body.html +++ b/phpBB/styles/prosilver/template/memberlist_body.html @@ -21,7 +21,7 @@

{GROUP_DESC} {GROUP_TYPE}

- {% EVENT memberlist_body_group_rank_desc_after %} + {% EVENT memberlist_body_group_desc_after %}

{AVATAR_IMG} From 12073855dd1ccb5efe2780af5c90e2c866d1a912 Mon Sep 17 00:00:00 2001 From: 3D-I Date: Thu, 29 Nov 2018 01:56:42 +0100 Subject: [PATCH 09/61] [ticket/15884] Add memberlist_body_* events update events.md PHPBB3-15884 --- phpBB/docs/events.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/phpBB/docs/events.md b/phpBB/docs/events.md index 4fd43eab98..9ab0a70a75 100644 --- a/phpBB/docs/events.md +++ b/phpBB/docs/events.md @@ -1133,7 +1133,7 @@ memberlist_body_group_desc_after * Locations: + styles/prosilver/template/memberlist_body.html * Since: 3.2.5-RC1 -* Purpose: Add data after the the group description in the group profile page. +* Purpose: Add data after the group descdiption and type in the group profile page. memberlist_body_group_rank_before === @@ -1142,12 +1142,12 @@ memberlist_body_group_rank_before * Since: 3.2.5-RC1 * Purpose: Add data before the group rank in the group profile page. -memberlist_body_group_desc_after +memberlist_body_group_rank_after === * Locations: + styles/prosilver/template/memberlist_body.html * Since: 3.2.5-RC1 -* Purpose: Add data after the group desc and type in the group profile page. +* Purpose: Add data after the group rank in the group profile page. memberlist_body_memberlist_after === From bf07331a0e4c58c24392b023077653f60cec6b6c Mon Sep 17 00:00:00 2001 From: 3D-I Date: Thu, 29 Nov 2018 02:41:16 +0100 Subject: [PATCH 10/61] [ticket/15884] Add memberlist_body_* events update description (typo) PHPBB3-15884 --- phpBB/docs/events.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/docs/events.md b/phpBB/docs/events.md index 9ab0a70a75..3bca180715 100644 --- a/phpBB/docs/events.md +++ b/phpBB/docs/events.md @@ -1133,7 +1133,7 @@ memberlist_body_group_desc_after * Locations: + styles/prosilver/template/memberlist_body.html * Since: 3.2.5-RC1 -* Purpose: Add data after the group descdiption and type in the group profile page. +* Purpose: Add data after the group description and type in the group profile page. memberlist_body_group_rank_before === From 565f6925410b1022529670d47f3b00c244ccaed7 Mon Sep 17 00:00:00 2001 From: battye Date: Thu, 29 Nov 2018 14:37:14 +0000 Subject: [PATCH 11/61] [ticket/15883] Use the new language object Using the new ->lang() format. Made the username comparison case insensitive. Also fixed a bug where the return to previous page link in the UCP was going back to the list of groups rather than the specific manage group page when an error occurred. PHPBB3-15883 --- phpBB/includes/acp/acp_groups.php | 7 +++++-- phpBB/includes/ucp/ucp_groups.php | 13 +++++++++---- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/phpBB/includes/acp/acp_groups.php b/phpBB/includes/acp/acp_groups.php index 20f913ff29..f541025bf2 100644 --- a/phpBB/includes/acp/acp_groups.php +++ b/phpBB/includes/acp/acp_groups.php @@ -29,6 +29,9 @@ class acp_groups global $phpbb_root_path, $phpbb_admin_path, $phpEx; global $request, $phpbb_container, $phpbb_dispatcher; + /** @var \phpbb\language\language $language Language object */ + $language = $phpbb_container->get('language'); + $user->add_lang('acp/groups'); $this->tpl_name = 'acp_groups'; $this->page_title = 'ACP_GROUPS_MANAGE'; @@ -293,7 +296,7 @@ class acp_groups // Add user/s to group if ($error = group_user_add($group_id, false, $name_ary, $group_name, $default, $leader, 0, $group_row)) { - $display_message = $user->lang[$error]; + $display_message = $language->lang($error); if ($error == 'GROUP_USERS_INVALID') { @@ -302,7 +305,7 @@ class acp_groups $actual_user_id_ary = false; user_get_id_name($actual_user_id_ary, $actual_name_ary, false, true); - $display_message = sprintf($user->lang['GROUP_USERS_INVALID'], implode($user->lang['COMMA_SEPARATOR'], array_diff($name_ary, $actual_name_ary))); + $display_message = $language->lang('GROUP_USERS_INVALID', implode($language->lang('COMMA_SEPARATOR'), array_udiff($name_ary, $actual_name_ary, 'strcasecmp'))); } trigger_error($display_message . adm_back_link($this->u_action . '&action=list&g=' . $group_id), E_USER_WARNING); diff --git a/phpBB/includes/ucp/ucp_groups.php b/phpBB/includes/ucp/ucp_groups.php index e32c855179..d0ac598920 100644 --- a/phpBB/includes/ucp/ucp_groups.php +++ b/phpBB/includes/ucp/ucp_groups.php @@ -32,6 +32,9 @@ class ucp_groups global $db, $user, $auth, $cache, $template; global $request, $phpbb_container, $phpbb_log; + /** @var \phpbb\language\language $language Language object */ + $language = $phpbb_container->get('language'); + $user->add_lang('groups'); $return_page = '

' . sprintf($user->lang['RETURN_PAGE'], '', ''); @@ -1054,10 +1057,12 @@ class ucp_groups if (confirm_box(true)) { + $return_manage_page = '

' . $language->lang('RETURN_PAGE', '', ''); + // Add user/s to group if ($error = group_user_add($group_id, false, $name_ary, $group_name, $default, 0, 0, $group_row)) { - $display_message = $user->lang[$error]; + $display_message = $language->lang($error); if ($error == 'GROUP_USERS_INVALID') { @@ -1066,13 +1071,13 @@ class ucp_groups $actual_user_id_ary = false; user_get_id_name($actual_user_id_ary, $actual_name_ary, false, true); - $display_message = sprintf($user->lang['GROUP_USERS_INVALID'], implode($user->lang['COMMA_SEPARATOR'], array_diff($name_ary, $actual_name_ary))); + $display_message = $language->lang('GROUP_USERS_INVALID', implode($language->lang('COMMA_SEPARATOR'), array_udiff($name_ary, $actual_name_ary, 'strcasecmp'))); } - trigger_error($display_message . $return_page); + trigger_error($display_message . $return_manage_page); } - trigger_error($user->lang['GROUP_USERS_ADDED'] . '

' . sprintf($user->lang['RETURN_PAGE'], '', '')); + trigger_error($language->lang('GROUP_USERS_ADDED') . $return_manage_page); } else { From e7a16f1eda4a08c9cbb6e61ff8a237df6167a8a1 Mon Sep 17 00:00:00 2001 From: 3D-I Date: Sat, 1 Dec 2018 01:51:18 +0100 Subject: [PATCH 12/61] [ticket/15884] Add more events update events.md (version) update events.md (new events) PHPBB3-15884 --- phpBB/docs/events.md | 39 ++++++++++++++----- .../prosilver/template/memberlist_body.html | 5 +++ 2 files changed, 35 insertions(+), 9 deletions(-) diff --git a/phpBB/docs/events.md b/phpBB/docs/events.md index 3bca180715..34917c417e 100644 --- a/phpBB/docs/events.md +++ b/phpBB/docs/events.md @@ -1114,60 +1114,74 @@ mcp_warn_user_add_warning_field_before * Since: 3.1.0-RC4 * Purpose: Add content during warning a user - before add warning field. +memberlist_body_page_header_after +=== +* Locations: + + styles/prosilver/template/memberlist_body.html +* Since: 3.2.6-RC1 +* Purpose: Add data after the page header. + +memberlist_body_page_title_before +=== +* Locations: + + styles/prosilver/template/memberlist_body.html +* Since: 3.2.6-RC1 +* Purpose: Add data before the page title. + memberlist_body_group_name_before === * Locations: + styles/prosilver/template/memberlist_body.html -* Since: 3.2.5-RC1 +* Since: 3.2.6-RC1 * Purpose: Add data before the group name in the group profile page. memberlist_body_group_name_after === * Locations: + styles/prosilver/template/memberlist_body.html -* Since: 3.2.5-RC1 +* Since: 3.2.6-RC1 * Purpose: Add data after the group name in the group profile page. memberlist_body_group_desc_after === * Locations: + styles/prosilver/template/memberlist_body.html -* Since: 3.2.5-RC1 +* Since: 3.2.6-RC1 * Purpose: Add data after the group description and type in the group profile page. memberlist_body_group_rank_before === * Locations: + styles/prosilver/template/memberlist_body.html -* Since: 3.2.5-RC1 +* Since: 3.2.6-RC1 * Purpose: Add data before the group rank in the group profile page. memberlist_body_group_rank_after === * Locations: + styles/prosilver/template/memberlist_body.html -* Since: 3.2.5-RC1 +* Since: 3.2.6-RC1 * Purpose: Add data after the group rank in the group profile page. memberlist_body_memberlist_after === * Locations: + styles/prosilver/template/memberlist_body.html -* Since: 3.2.5-RC1 +* Since: 3.2.6-RC1 * Purpose: Add data after the last row in the memberlist. memberlist_body_leaders_set_after === * Locations: + styles/prosilver/template/memberlist_body.html -* Since: 3.2.5-RC1 +* Since: 3.2.6-RC1 * Purpose: Add data after the last row in the memberlist mode leaders. memberlist_body_show_group_after === * Locations: + styles/prosilver/template/memberlist_body.html -* Since: 3.2.5-RC1 +* Since: 3.2.6-RC1 * Purpose: Add data after the last row in the memberlist mode group. memberlist_body_rank_append @@ -1206,9 +1220,16 @@ memberlist_body_memberrow_after === * Locations: + styles/prosilver/template/memberlist_body.html -* Since: 3.2.5-RC1 +* Since: 3.2.6-RC1 * Purpose: Add data after the last memberrow in the memberlist. +memberlist_body_page_footer_before +=== +* Locations: + + styles/prosilver/template/memberlist_body.html +* Since: 3.2.6-RC1 +* Purpose: Add data before the page footer. + memberlist_email_before === * Locations: diff --git a/phpBB/styles/prosilver/template/memberlist_body.html b/phpBB/styles/prosilver/template/memberlist_body.html index f605766123..5f03ad99cc 100644 --- a/phpBB/styles/prosilver/template/memberlist_body.html +++ b/phpBB/styles/prosilver/template/memberlist_body.html @@ -12,6 +12,8 @@ +{% EVENT memberlist_body_page_header_after %} + {% EVENT memberlist_body_group_name_before %}

style="color:#{GROUP_COLOR};">{GROUP_NAME}

@@ -31,6 +33,7 @@ {% EVENT memberlist_body_group_rank_after %}

+ {% EVENT memberlist_body_page_title_before %}

{PAGE_TITLE}{L_COLON} {SEARCH_WORDS}

@@ -166,6 +169,8 @@
+{% EVENT memberlist_body_page_footer_before %} + From 8b4c77784e9bd1788244b19966802c61947f18aa Mon Sep 17 00:00:00 2001 From: 3D-I Date: Sat, 1 Dec 2018 04:35:45 +0100 Subject: [PATCH 13/61] [ticket/15890] Add core.memberlist_modify_viewprofile_sql PHPBB3-15890 --- phpBB/memberlist.php | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php index 977857da59..13cb3b96d5 100644 --- a/phpBB/memberlist.php +++ b/phpBB/memberlist.php @@ -489,9 +489,31 @@ switch ($mode) } // Get user... - $sql = 'SELECT * - FROM ' . USERS_TABLE . ' - WHERE ' . (($username) ? "username_clean = '" . $db->sql_escape(utf8_clean_string($username)) . "'" : "user_id = $user_id"); + $sql_array = array( + 'SELECT' => 'u.*', + 'FROM' => array( + USERS_TABLE => 'u' + ), + 'WHERE' => (($username) ? "u.username_clean = '" . $db->sql_escape(utf8_clean_string($username)) . "'" : "u.user_id = $user_id"), + ); + + /** + * Modify user data SQL before member profile row is created + * + * @event core.memberlist_modify_viewprofile_sql + * @var int user_id The user ID + * @var string username The username + * @var array sql_array Array containing the main query + * @since 3.2.6-RC1 + */ + $vars = array( + 'user_id', + 'username', + 'sql_array', + ); + extract($phpbb_dispatcher->trigger_event('core.memberlist_modify_viewprofile_sql', compact($vars))); + + $sql = $db->sql_build_query('SELECT', $sql_array); $result = $db->sql_query($sql); $member = $db->sql_fetchrow($result); $db->sql_freeresult($result); From 47acbdd1388096586294cad6f93f62fdccd90b9c Mon Sep 17 00:00:00 2001 From: rubencm Date: Sat, 1 Dec 2018 20:51:59 +0000 Subject: [PATCH 14/61] [ticket/15869] Allow multibyte characters in hostname during installation PHPBB3-15869 --- .../install/module/obtain_data/task/obtain_email_data.php | 6 +++--- .../install/module/obtain_data/task/obtain_server_data.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/phpBB/phpbb/install/module/obtain_data/task/obtain_email_data.php b/phpBB/phpbb/install/module/obtain_data/task/obtain_email_data.php index e8a9c971b7..7cd0d7bf23 100644 --- a/phpBB/phpbb/install/module/obtain_data/task/obtain_email_data.php +++ b/phpBB/phpbb/install/module/obtain_data/task/obtain_email_data.php @@ -50,11 +50,11 @@ class obtain_email_data extends \phpbb\install\task_base implements \phpbb\insta // E-mail data $email_enable = $this->io_handler->get_input('email_enable', true); $smtp_delivery = $this->io_handler->get_input('smtp_delivery', ''); - $smtp_host = $this->io_handler->get_input('smtp_host', ''); + $smtp_host = $this->io_handler->get_input('smtp_host', '', true); $smtp_port = $this->io_handler->get_input('smtp_port', ''); $smtp_auth = $this->io_handler->get_input('smtp_auth', ''); - $smtp_user = $this->io_handler->get_input('smtp_user', ''); - $smtp_passwd = $this->io_handler->get_input('smtp_pass', ''); + $smtp_user = $this->io_handler->get_input('smtp_user', '', true); + $smtp_passwd = $this->io_handler->get_input('smtp_pass', '', true); $auth_methods = array('PLAIN', 'LOGIN', 'CRAM-MD5', 'DIGEST-MD5', 'POP-BEFORE-SMTP'); diff --git a/phpBB/phpbb/install/module/obtain_data/task/obtain_server_data.php b/phpBB/phpbb/install/module/obtain_data/task/obtain_server_data.php index 1ef70eae08..135a75ff8c 100644 --- a/phpBB/phpbb/install/module/obtain_data/task/obtain_server_data.php +++ b/phpBB/phpbb/install/module/obtain_data/task/obtain_server_data.php @@ -79,7 +79,7 @@ class obtain_server_data extends \phpbb\install\task_base implements \phpbb\inst $cookie_secure = $this->io_handler->get_input('cookie_secure', $cookie_secure); $server_protocol = $this->io_handler->get_input('server_protocol', $server_protocol); $force_server_vars = $this->io_handler->get_input('force_server_vars', 0); - $server_name = $this->io_handler->get_input('server_name', $server_name); + $server_name = $this->io_handler->get_input('server_name', $server_name, true); $server_port = $this->io_handler->get_input('server_port', $server_port); $script_path = $this->io_handler->get_input('script_path', $script_path); From 91847ed1fd3953da70e8df7f55a0274bbd9ebccf Mon Sep 17 00:00:00 2001 From: rubencm Date: Sun, 2 Dec 2018 10:26:19 +0000 Subject: [PATCH 15/61] [ticket/15869] Allow multibyte characters in more variables PHPBB3-15869 --- .../module/obtain_data/task/obtain_database_data.php | 8 ++++---- .../module/obtain_data/task/obtain_server_data.php | 2 +- .../module/obtain_data/task/obtain_update_ftp_data.php | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/phpBB/phpbb/install/module/obtain_data/task/obtain_database_data.php b/phpBB/phpbb/install/module/obtain_data/task/obtain_database_data.php index dc7b060746..6ec1e612b9 100644 --- a/phpBB/phpbb/install/module/obtain_data/task/obtain_database_data.php +++ b/phpBB/phpbb/install/module/obtain_data/task/obtain_database_data.php @@ -78,10 +78,10 @@ class obtain_database_data extends \phpbb\install\task_base implements \phpbb\in $dbms = $this->io_handler->get_input('dbms', ''); $dbhost = $this->io_handler->get_input('dbhost', '', true); $dbport = $this->io_handler->get_input('dbport', ''); - $dbuser = $this->io_handler->get_input('dbuser', ''); - $dbpasswd = $this->io_handler->get_raw_input('dbpasswd', ''); - $dbname = $this->io_handler->get_input('dbname', ''); - $table_prefix = $this->io_handler->get_input('table_prefix', ''); + $dbuser = $this->io_handler->get_input('dbuser', '', true); + $dbpasswd = $this->io_handler->get_raw_input('dbpasswd', '', true); + $dbname = $this->io_handler->get_input('dbname', '', true); + $table_prefix = $this->io_handler->get_input('table_prefix', '', true); // Check database data $user_data_vaild = $this->check_database_data($dbms, $dbhost, $dbport, $dbuser, $dbpasswd, $dbname, $table_prefix); diff --git a/phpBB/phpbb/install/module/obtain_data/task/obtain_server_data.php b/phpBB/phpbb/install/module/obtain_data/task/obtain_server_data.php index 135a75ff8c..5096ce284e 100644 --- a/phpBB/phpbb/install/module/obtain_data/task/obtain_server_data.php +++ b/phpBB/phpbb/install/module/obtain_data/task/obtain_server_data.php @@ -81,7 +81,7 @@ class obtain_server_data extends \phpbb\install\task_base implements \phpbb\inst $force_server_vars = $this->io_handler->get_input('force_server_vars', 0); $server_name = $this->io_handler->get_input('server_name', $server_name, true); $server_port = $this->io_handler->get_input('server_port', $server_port); - $script_path = $this->io_handler->get_input('script_path', $script_path); + $script_path = $this->io_handler->get_input('script_path', $script_path, true); // Clean up script path if ($script_path !== '/') diff --git a/phpBB/phpbb/install/module/obtain_data/task/obtain_update_ftp_data.php b/phpBB/phpbb/install/module/obtain_data/task/obtain_update_ftp_data.php index f31472fc58..3c17576c13 100644 --- a/phpBB/phpbb/install/module/obtain_data/task/obtain_update_ftp_data.php +++ b/phpBB/phpbb/install/module/obtain_data/task/obtain_update_ftp_data.php @@ -85,10 +85,10 @@ class obtain_update_ftp_data extends task_base $method = $methods[0]; } - $ftp_host = $this->iohandler->get_input('ftp_host', ''); - $ftp_user = $this->iohandler->get_input('ftp_user', ''); - $ftp_pass = htmlspecialchars_decode($this->iohandler->get_input('ftp_pass', '')); - $ftp_path = $this->iohandler->get_input('ftp_path', ''); + $ftp_host = $this->iohandler->get_input('ftp_host', '', true); + $ftp_user = $this->iohandler->get_input('ftp_user', '', true); + $ftp_pass = htmlspecialchars_decode($this->iohandler->get_input('ftp_pass', '', true)); + $ftp_path = $this->iohandler->get_input('ftp_path', '', true); $ftp_port = $this->iohandler->get_input('ftp_port', 21); $ftp_time = $this->iohandler->get_input('ftp_timeout', 10); From 75b993c6a3862a971ca809494811f16edf28d0c7 Mon Sep 17 00:00:00 2001 From: Jakub Senko Date: Mon, 19 Nov 2018 15:33:57 +0100 Subject: [PATCH 16/61] [ticket/15898] Add core.ucp_pm_compose_template PHPBB3-15898 --- phpBB/includes/ucp/ucp_pm_compose.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php index cc796d766b..1763434613 100644 --- a/phpBB/includes/ucp/ucp_pm_compose.php +++ b/phpBB/includes/ucp/ucp_pm_compose.php @@ -1191,7 +1191,7 @@ function compose_pm($id, $mode, $action, $user_folders = array()) $controller_helper = $phpbb_container->get('controller.helper'); // Start assigning vars for main posting page ... - $template->assign_vars(array( + $template_ary = array( 'L_POST_A' => $page_title, 'L_ICON' => $user->lang['PM_ICON'], 'L_MESSAGE_BODY_EXPLAIN' => $user->lang('MESSAGE_BODY_EXPLAIN', (int) $config['max_post_chars']), @@ -1236,7 +1236,19 @@ function compose_pm($id, $mode, $action, $user_folders = array()) 'S_CLOSE_PROGRESS_WINDOW' => isset($_POST['add_file']), 'U_PROGRESS_BAR' => append_sid("{$phpbb_root_path}posting.$phpEx", 'f=0&mode=popup'), 'UA_PROGRESS_BAR' => addslashes(append_sid("{$phpbb_root_path}posting.$phpEx", 'f=0&mode=popup')), - )); + ); + + /** + * Modify the default template vars + * + * @event core.ucp_pm_compose_template + * @var array template_ary Template variables + * @since 3.2.5 + */ + $vars = array('template_ary'); + extract($phpbb_dispatcher->trigger_event('core.ucp_pm_compose_template', compact($vars))); + + $template->assign_vars($template_ary); // Build custom bbcodes array display_custom_bbcodes(); From fe72d874609c0b15dece23d506050fd7771dbf89 Mon Sep 17 00:00:00 2001 From: mrgoldy Date: Tue, 4 Dec 2018 01:48:09 +0100 Subject: [PATCH 17/61] [ticket/15901] Add mcp_post_ template events PHPBB3-15901 --- phpBB/docs/events.md | 14 ++++++++++++++ phpBB/styles/prosilver/template/mcp_post.html | 4 ++++ 2 files changed, 18 insertions(+) diff --git a/phpBB/docs/events.md b/phpBB/docs/events.md index de3952cafc..8aad9a5c60 100644 --- a/phpBB/docs/events.md +++ b/phpBB/docs/events.md @@ -995,6 +995,20 @@ mcp_post_additional_options * Since: 3.1.5-RC1 * Purpose: Add content within the list of post moderation actions +mcp_post_text_before +=== +* Locations: + + styles/prosilver/template/mcp_post.html +* Since 3.2.6-RC1 +* Purpose: Add content before the post text + +mcp_post_text_after +=== +* Locations: + + styles/prosilver/template/mcp_post.html +* Since: 3.2.6-RC1 +* Purpose: Add content after the post text + mcp_post_report_buttons_top_after === * Locations: diff --git a/phpBB/styles/prosilver/template/mcp_post.html b/phpBB/styles/prosilver/template/mcp_post.html index cf9d0bd6c1..c2297a8053 100644 --- a/phpBB/styles/prosilver/template/mcp_post.html +++ b/phpBB/styles/prosilver/template/mcp_post.html @@ -108,10 +108,14 @@

+ {% EVENT mcp_post_text_before %} +
{POST_PREVIEW}
+ {% EVENT mcp_post_text_after %} +
{L_ATTACHMENTS}
From 337d5db292e504f6df87eb3e7b4519c5baf49dac Mon Sep 17 00:00:00 2001 From: mrgoldy Date: Tue, 4 Dec 2018 01:56:34 +0100 Subject: [PATCH 18/61] [ticket/15901] Alphabetical order After has to be before before. Mind twist. PHPBB3-15901 --- phpBB/docs/events.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/phpBB/docs/events.md b/phpBB/docs/events.md index 8aad9a5c60..c1760c34d7 100644 --- a/phpBB/docs/events.md +++ b/phpBB/docs/events.md @@ -995,13 +995,6 @@ mcp_post_additional_options * Since: 3.1.5-RC1 * Purpose: Add content within the list of post moderation actions -mcp_post_text_before -=== -* Locations: - + styles/prosilver/template/mcp_post.html -* Since 3.2.6-RC1 -* Purpose: Add content before the post text - mcp_post_text_after === * Locations: @@ -1009,6 +1002,13 @@ mcp_post_text_after * Since: 3.2.6-RC1 * Purpose: Add content after the post text +mcp_post_text_before +=== +* Locations: + + styles/prosilver/template/mcp_post.html +* Since 3.2.6-RC1 +* Purpose: Add content before the post text + mcp_post_report_buttons_top_after === * Locations: From 4554376ac85f09bce3815fb2af6f7665a6ebb5b2 Mon Sep 17 00:00:00 2001 From: mrgoldy Date: Tue, 4 Dec 2018 02:31:14 +0100 Subject: [PATCH 19/61] [ticket/15901] Add missing semi-colon PHPBB3-15901 --- phpBB/docs/events.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/docs/events.md b/phpBB/docs/events.md index c1760c34d7..e587b0d39a 100644 --- a/phpBB/docs/events.md +++ b/phpBB/docs/events.md @@ -1006,7 +1006,7 @@ mcp_post_text_before === * Locations: + styles/prosilver/template/mcp_post.html -* Since 3.2.6-RC1 +* Since: 3.2.6-RC1 * Purpose: Add content before the post text mcp_post_report_buttons_top_after From fe382708f5d8dae6a49d5032d874bdfc6b26a2f2 Mon Sep 17 00:00:00 2001 From: mrgoldy Date: Tue, 4 Dec 2018 03:22:20 +0100 Subject: [PATCH 20/61] [ticket/15901] Alphabetical order PHPBB3-15901 --- phpBB/docs/events.md | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/phpBB/docs/events.md b/phpBB/docs/events.md index e587b0d39a..8b38d554a3 100644 --- a/phpBB/docs/events.md +++ b/phpBB/docs/events.md @@ -995,20 +995,6 @@ mcp_post_additional_options * Since: 3.1.5-RC1 * Purpose: Add content within the list of post moderation actions -mcp_post_text_after -=== -* Locations: - + styles/prosilver/template/mcp_post.html -* Since: 3.2.6-RC1 -* Purpose: Add content after the post text - -mcp_post_text_before -=== -* Locations: - + styles/prosilver/template/mcp_post.html -* Since: 3.2.6-RC1 -* Purpose: Add content before the post text - mcp_post_report_buttons_top_after === * Locations: @@ -1023,6 +1009,20 @@ mcp_post_report_buttons_top_before * Since: 3.2.4-RC1 * Purpose: Add content before report buttons +mcp_post_text_after +=== +* Locations: + + styles/prosilver/template/mcp_post.html +* Since: 3.2.6-RC1 +* Purpose: Add content after the post text + +mcp_post_text_before +=== +* Locations: + + styles/prosilver/template/mcp_post.html +* Since: 3.2.6-RC1 +* Purpose: Add content before the post text + mcp_topic_options_after === * Locations: From 83f4074116e646507bbb448f745e0d9b356aa593 Mon Sep 17 00:00:00 2001 From: kasimi Date: Wed, 12 Dec 2018 12:34:16 +0100 Subject: [PATCH 21/61] [ticket/15910] Pass object arguments by reference implicitly PHPBB3-15910 --- phpBB/includes/acp/acp_inactive.php | 4 ++-- phpBB/includes/acp/acp_permissions.php | 6 +++--- phpBB/includes/acp/acp_profile.php | 4 ++-- phpBB/includes/acp/acp_users.php | 4 ++-- phpBB/includes/functions_compatibility.php | 2 +- phpBB/includes/functions_mcp.php | 16 ++++++++-------- phpBB/includes/mcp/mcp_logs.php | 4 ++-- phpBB/includes/mcp/mcp_main.php | 4 ++-- phpBB/includes/mcp/mcp_notes.php | 4 ++-- phpBB/includes/mcp/mcp_pm_reports.php | 4 ++-- phpBB/includes/mcp/mcp_queue.php | 4 ++-- phpBB/includes/mcp/mcp_reports.php | 4 ++-- phpBB/includes/mcp/mcp_warn.php | 4 ++-- phpBB/includes/ucp/ucp_main.php | 4 ++-- phpBB/phpbb/captcha/plugins/gd.php | 2 +- phpBB/phpbb/captcha/plugins/gd_wave.php | 2 +- phpBB/phpbb/captcha/plugins/nogd.php | 2 +- phpBB/phpbb/captcha/plugins/qa.php | 4 ++-- phpBB/phpbb/captcha/plugins/recaptcha.php | 2 +- phpBB/phpbb/files/upload.php | 8 ++++---- tests/upload/filespec_test.php | 2 +- 21 files changed, 45 insertions(+), 45 deletions(-) diff --git a/phpBB/includes/acp/acp_inactive.php b/phpBB/includes/acp/acp_inactive.php index 66f0d2116c..4ee4cd4816 100644 --- a/phpBB/includes/acp/acp_inactive.php +++ b/phpBB/includes/acp/acp_inactive.php @@ -24,9 +24,9 @@ class acp_inactive var $u_action; var $p_master; - function __construct(&$p_master) + function __construct($p_master) { - $this->p_master = &$p_master; + $this->p_master = $p_master; } function main($id, $mode) diff --git a/phpBB/includes/acp/acp_permissions.php b/phpBB/includes/acp/acp_permissions.php index 8e05b95849..e683b1972e 100644 --- a/phpBB/includes/acp/acp_permissions.php +++ b/phpBB/includes/acp/acp_permissions.php @@ -676,7 +676,7 @@ class acp_permissions /** * Apply permissions */ - function set_permissions($mode, $permission_type, &$auth_admin, &$user_id, &$group_id) + function set_permissions($mode, $permission_type, $auth_admin, &$user_id, &$group_id) { global $db, $cache, $user, $auth; global $request; @@ -765,7 +765,7 @@ class acp_permissions /** * Apply all permissions */ - function set_all_permissions($mode, $permission_type, &$auth_admin, &$user_id, &$group_id) + function set_all_permissions($mode, $permission_type, $auth_admin, &$user_id, &$group_id) { global $db, $cache, $user, $auth; global $request; @@ -881,7 +881,7 @@ class acp_permissions /** * Remove permissions */ - function remove_permissions($mode, $permission_type, &$auth_admin, &$user_id, &$group_id, &$forum_id) + function remove_permissions($mode, $permission_type, $auth_admin, &$user_id, &$group_id, &$forum_id) { global $user, $db, $cache, $auth; diff --git a/phpBB/includes/acp/acp_profile.php b/phpBB/includes/acp/acp_profile.php index d89c200a1b..49da7d84a4 100644 --- a/phpBB/includes/acp/acp_profile.php +++ b/phpBB/includes/acp/acp_profile.php @@ -845,7 +845,7 @@ class acp_profile /** * Build all Language specific options */ - function build_language_options(&$cp, $field_type, $action = 'create') + function build_language_options($cp, $field_type, $action = 'create') { global $user, $config, $db, $request; @@ -942,7 +942,7 @@ class acp_profile /** * Save Profile Field */ - function save_profile_field(&$cp, $field_type, $action = 'create') + function save_profile_field($cp, $field_type, $action = 'create') { global $db, $config, $user, $phpbb_container, $phpbb_log, $request, $phpbb_dispatcher; diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index b74fe535ee..2d1eaadfae 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -24,9 +24,9 @@ class acp_users var $u_action; var $p_master; - function __construct(&$p_master) + function __construct($p_master) { - $this->p_master = &$p_master; + $this->p_master = $p_master; } function main($id, $mode) diff --git a/phpBB/includes/functions_compatibility.php b/phpBB/includes/functions_compatibility.php index 4fe7e71117..e95fa40a58 100644 --- a/phpBB/includes/functions_compatibility.php +++ b/phpBB/includes/functions_compatibility.php @@ -391,7 +391,7 @@ function request_var($var_name, $default, $multibyte = false, $cookie = false, $ * * @deprecated 3.1.0 (To be removed: 3.3.0) */ -function get_tables(&$db) +function get_tables($db) { $db_tools_factory = new \phpbb\db\tools\factory(); $db_tools = $db_tools_factory->get($db); diff --git a/phpBB/includes/functions_mcp.php b/phpBB/includes/functions_mcp.php index d91993b23f..75e24618de 100644 --- a/phpBB/includes/functions_mcp.php +++ b/phpBB/includes/functions_mcp.php @@ -22,12 +22,12 @@ if (!defined('IN_PHPBB')) /** * Functions used to generate additional URL paramters */ -function phpbb_module__url($mode, &$module_row) +function phpbb_module__url($mode, $module_row) { return phpbb_extra_url(); } -function phpbb_module_notes_url($mode, &$module_row) +function phpbb_module_notes_url($mode, $module_row) { if ($mode == 'front') { @@ -38,7 +38,7 @@ function phpbb_module_notes_url($mode, &$module_row) return ($user_id) ? "&u=$user_id" : ''; } -function phpbb_module_warn_url($mode, &$module_row) +function phpbb_module_warn_url($mode, $module_row) { if ($mode == 'front' || $mode == 'list') { @@ -64,27 +64,27 @@ function phpbb_module_warn_url($mode, &$module_row) } } -function phpbb_module_main_url($mode, &$module_row) +function phpbb_module_main_url($mode, $module_row) { return phpbb_extra_url(); } -function phpbb_module_logs_url($mode, &$module_row) +function phpbb_module_logs_url($mode, $module_row) { return phpbb_extra_url(); } -function phpbb_module_ban_url($mode, &$module_row) +function phpbb_module_ban_url($mode, $module_row) { return phpbb_extra_url(); } -function phpbb_module_queue_url($mode, &$module_row) +function phpbb_module_queue_url($mode, $module_row) { return phpbb_extra_url(); } -function phpbb_module_reports_url($mode, &$module_row) +function phpbb_module_reports_url($mode, $module_row) { return phpbb_extra_url(); } diff --git a/phpBB/includes/mcp/mcp_logs.php b/phpBB/includes/mcp/mcp_logs.php index 049f24b262..79f9d35ebe 100644 --- a/phpBB/includes/mcp/mcp_logs.php +++ b/phpBB/includes/mcp/mcp_logs.php @@ -28,9 +28,9 @@ class mcp_logs var $u_action; var $p_master; - function __construct(&$p_master) + function __construct($p_master) { - $this->p_master = &$p_master; + $this->p_master = $p_master; } function main($id, $mode) diff --git a/phpBB/includes/mcp/mcp_main.php b/phpBB/includes/mcp/mcp_main.php index 196d2f995f..a4e3a74ba7 100644 --- a/phpBB/includes/mcp/mcp_main.php +++ b/phpBB/includes/mcp/mcp_main.php @@ -28,9 +28,9 @@ class mcp_main var $p_master; var $u_action; - function __construct(&$p_master) + function __construct($p_master) { - $this->p_master = &$p_master; + $this->p_master = $p_master; } function main($id, $mode) diff --git a/phpBB/includes/mcp/mcp_notes.php b/phpBB/includes/mcp/mcp_notes.php index 12b116e495..a4c2356a43 100644 --- a/phpBB/includes/mcp/mcp_notes.php +++ b/phpBB/includes/mcp/mcp_notes.php @@ -28,9 +28,9 @@ class mcp_notes var $p_master; var $u_action; - function __construct(&$p_master) + function __construct($p_master) { - $this->p_master = &$p_master; + $this->p_master = $p_master; } function main($id, $mode) diff --git a/phpBB/includes/mcp/mcp_pm_reports.php b/phpBB/includes/mcp/mcp_pm_reports.php index ba89733bfe..eecfe9cbc8 100644 --- a/phpBB/includes/mcp/mcp_pm_reports.php +++ b/phpBB/includes/mcp/mcp_pm_reports.php @@ -28,9 +28,9 @@ class mcp_pm_reports var $p_master; var $u_action; - function __construct(&$p_master) + function __construct($p_master) { - $this->p_master = &$p_master; + $this->p_master = $p_master; } function main($id, $mode) diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php index a95c8fad44..dec583f6f4 100644 --- a/phpBB/includes/mcp/mcp_queue.php +++ b/phpBB/includes/mcp/mcp_queue.php @@ -28,9 +28,9 @@ class mcp_queue var $p_master; var $u_action; - public function __construct(&$p_master) + public function __construct($p_master) { - $this->p_master = &$p_master; + $this->p_master = $p_master; } public function main($id, $mode) diff --git a/phpBB/includes/mcp/mcp_reports.php b/phpBB/includes/mcp/mcp_reports.php index b4018184a7..4600257344 100644 --- a/phpBB/includes/mcp/mcp_reports.php +++ b/phpBB/includes/mcp/mcp_reports.php @@ -28,9 +28,9 @@ class mcp_reports var $p_master; var $u_action; - function __construct(&$p_master) + function __construct($p_master) { - $this->p_master = &$p_master; + $this->p_master = $p_master; } function main($id, $mode) diff --git a/phpBB/includes/mcp/mcp_warn.php b/phpBB/includes/mcp/mcp_warn.php index 888069ef5d..df175133fc 100644 --- a/phpBB/includes/mcp/mcp_warn.php +++ b/phpBB/includes/mcp/mcp_warn.php @@ -28,9 +28,9 @@ class mcp_warn var $p_master; var $u_action; - function __construct(&$p_master) + function __construct($p_master) { - $this->p_master = &$p_master; + $this->p_master = $p_master; } function main($id, $mode) diff --git a/phpBB/includes/ucp/ucp_main.php b/phpBB/includes/ucp/ucp_main.php index ec652a5e45..5214de8c7c 100644 --- a/phpBB/includes/ucp/ucp_main.php +++ b/phpBB/includes/ucp/ucp_main.php @@ -28,9 +28,9 @@ class ucp_main var $p_master; var $u_action; - function __construct(&$p_master) + function __construct($p_master) { - $this->p_master = &$p_master; + $this->p_master = $p_master; } function main($id, $mode) diff --git a/phpBB/phpbb/captcha/plugins/gd.php b/phpBB/phpbb/captcha/plugins/gd.php index 831e5bcfdf..6d3c9bb3d2 100644 --- a/phpBB/phpbb/captcha/plugins/gd.php +++ b/phpBB/phpbb/captcha/plugins/gd.php @@ -51,7 +51,7 @@ class gd extends captcha_abstract return 'CAPTCHA_GD'; } - function acp_page($id, &$module) + function acp_page($id, $module) { global $user, $template, $phpbb_log, $request; global $config; diff --git a/phpBB/phpbb/captcha/plugins/gd_wave.php b/phpBB/phpbb/captcha/plugins/gd_wave.php index bde46f8815..4ac26ed2b7 100644 --- a/phpBB/phpbb/captcha/plugins/gd_wave.php +++ b/phpBB/phpbb/captcha/plugins/gd_wave.php @@ -33,7 +33,7 @@ class gd_wave extends captcha_abstract return '\\phpbb\\captcha\\gd_wave'; } - function acp_page($id, &$module) + function acp_page($id, $module) { global $user; diff --git a/phpBB/phpbb/captcha/plugins/nogd.php b/phpBB/phpbb/captcha/plugins/nogd.php index 6845e5935c..da67cd2bf4 100644 --- a/phpBB/phpbb/captcha/plugins/nogd.php +++ b/phpBB/phpbb/captcha/plugins/nogd.php @@ -33,7 +33,7 @@ class nogd extends captcha_abstract return '\\phpbb\\captcha\\non_gd'; } - function acp_page($id, &$module) + function acp_page($id, $module) { global $user; diff --git a/phpBB/phpbb/captcha/plugins/qa.php b/phpBB/phpbb/captcha/plugins/qa.php index 7797212ac9..8f41434601 100644 --- a/phpBB/phpbb/captcha/plugins/qa.php +++ b/phpBB/phpbb/captcha/plugins/qa.php @@ -638,7 +638,7 @@ class qa /** * API function - The ACP backend, this marks the end of the easy methods */ - function acp_page($id, &$module) + function acp_page($id, $module) { global $config, $request, $phpbb_log, $template, $user; @@ -776,7 +776,7 @@ class qa /** * This handles the list overview */ - function acp_question_list(&$module) + function acp_question_list($module) { global $db, $template; diff --git a/phpBB/phpbb/captcha/plugins/recaptcha.php b/phpBB/phpbb/captcha/plugins/recaptcha.php index 152709a9ea..b7c0b5f5e2 100644 --- a/phpBB/phpbb/captcha/plugins/recaptcha.php +++ b/phpBB/phpbb/captcha/plugins/recaptcha.php @@ -66,7 +66,7 @@ class recaptcha extends captcha_abstract throw new \Exception('No generator class given.'); } - function acp_page($id, &$module) + function acp_page($id, $module) { global $config, $template, $user, $phpbb_log, $request; diff --git a/phpBB/phpbb/files/upload.php b/phpBB/phpbb/files/upload.php index a9bf74094d..50e15c9844 100644 --- a/phpBB/phpbb/files/upload.php +++ b/phpBB/phpbb/files/upload.php @@ -261,7 +261,7 @@ class upload * * @param filespec $file Instance of filespec class */ - public function common_checks(&$file) + public function common_checks($file) { // Filesize is too big or it's 0 if it was larger than the maxsize in the upload form if ($this->max_filesize && ($file->get('filesize') > $this->max_filesize || $file->get('filesize') == 0)) @@ -297,7 +297,7 @@ class upload * * @return bool True if extension is allowed, false if not */ - public function valid_extension(&$file) + public function valid_extension($file) { return (in_array($file->get('extension'), $this->allowed_extensions)) ? true : false; } @@ -310,7 +310,7 @@ class upload * @return bool True if dimensions are valid or no constraints set, false * if not */ - public function valid_dimensions(&$file) + public function valid_dimensions($file) { if (!$this->max_width && !$this->max_height && !$this->min_width && !$this->min_height) { @@ -350,7 +350,7 @@ class upload * * @return bool True if content is valid, false if not */ - public function valid_content(&$file) + public function valid_content($file) { return ($file->check_content($this->disallowed_content)); } diff --git a/tests/upload/filespec_test.php b/tests/upload/filespec_test.php index 18b6deed1f..b41b95d925 100644 --- a/tests/upload/filespec_test.php +++ b/tests/upload/filespec_test.php @@ -79,7 +79,7 @@ class phpbb_filespec_test extends phpbb_test_case $this->phpbb_root_path = $phpbb_root_path; } - private function set_reflection_property(&$class, $property_name, $value) + private function set_reflection_property($class, $property_name, $value) { $property = new ReflectionProperty($class, $property_name); $property->setAccessible(true); From cc49d8f3256580991cdd074d00ed0983a270ca75 Mon Sep 17 00:00:00 2001 From: GanstaZ Date: Sat, 15 Dec 2018 18:37:31 +0200 Subject: [PATCH 22/61] [ticket/15914] Add core.modify_memberlist_viewprofile_group* events PHPBB3-15914 --- phpBB/memberlist.php | 51 ++++++++++++++++++++++++++++++++++++++------ 1 file changed, 45 insertions(+), 6 deletions(-) diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php index d0dd70af01..8b5a7d2ce0 100644 --- a/phpBB/memberlist.php +++ b/phpBB/memberlist.php @@ -523,12 +523,37 @@ switch ($mode) $sql_uid_ary = ($auth_hidden_groups) ? array($user_id) : array($user_id, (int) $user->data['user_id']); // Do the SQL thang - $sql = 'SELECT g.group_id, g.group_name, g.group_type, ug.user_id - FROM ' . GROUPS_TABLE . ' g, ' . USER_GROUP_TABLE . ' ug - WHERE ' . $db->sql_in_set('ug.user_id', $sql_uid_ary) . ' - AND g.group_id = ug.group_id - AND ug.user_pending = 0'; - $result = $db->sql_query($sql); + $sql_ary = [ + 'SELECT' => 'g.group_id, g.group_name, g.group_type, g.group_rank, ug.user_id', + + 'FROM' => [ + GROUPS_TABLE => 'g', + ], + + 'LEFT_JOIN' => [ + [ + 'FROM' => [USER_GROUP_TABLE => 'ug'], + 'ON' => 'g.group_id = ug.group_id', + ], + ], + + 'WHERE' => $db->sql_in_set('ug.user_id', $sql_uid_ary) . ' + AND ug.user_pending = 0', + ]; + + /** + * Modify the query used to get the group data + * + * @event core.modify_memberlist_viewprofile_group_sql + * @var array sql_ary Array containing the query + * @since 3.2.5 + */ + $vars = array( + 'sql_ary', + ); + extract($phpbb_dispatcher->trigger_event('core.modify_memberlist_viewprofile_group_sql', compact($vars))); + + $result = $db->sql_query($db->sql_build_query('SELECT', $sql_ary)); // Divide data into profile data and current user data $profile_groups = $user_groups = array(); @@ -567,6 +592,20 @@ switch ($mode) unset($user_groups); asort($group_sort); + /** + * Modify group data before options is created and data is unset + * + * @event core.modify_memberlist_viewprofile_group_data + * @var array group_data Array containing the group data + * @var array group_sort Array containing the sorted group data + * @since 3.2.5 + */ + $vars = array( + 'group_data', + 'group_sort', + ); + extract($phpbb_dispatcher->trigger_event('core.modify_memberlist_viewprofile_group_data', compact($vars))); + $group_options = ''; foreach ($group_sort as $group_id => $null) { From 349ab42fdc994c5fa16436bd2d82df0ef4019f16 Mon Sep 17 00:00:00 2001 From: GanstaZ Date: Sat, 15 Dec 2018 19:22:38 +0200 Subject: [PATCH 23/61] [ticket/15914] fix sql line PHPBB3-15914 --- phpBB/memberlist.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php index 8b5a7d2ce0..6a528c82c3 100644 --- a/phpBB/memberlist.php +++ b/phpBB/memberlist.php @@ -524,7 +524,7 @@ switch ($mode) // Do the SQL thang $sql_ary = [ - 'SELECT' => 'g.group_id, g.group_name, g.group_type, g.group_rank, ug.user_id', + 'SELECT' => 'g.group_id, g.group_name, g.group_type, ug.user_id', 'FROM' => [ GROUPS_TABLE => 'g', From 552bda626665e3f99e1b77f77edb833bb0e2b667 Mon Sep 17 00:00:00 2001 From: GanstaZ Date: Sat, 22 Dec 2018 22:33:35 +0200 Subject: [PATCH 24/61] [ticket/15914] Change since PHPBB3-15914 --- phpBB/memberlist.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php index 6a528c82c3..35472a337f 100644 --- a/phpBB/memberlist.php +++ b/phpBB/memberlist.php @@ -546,7 +546,7 @@ switch ($mode) * * @event core.modify_memberlist_viewprofile_group_sql * @var array sql_ary Array containing the query - * @since 3.2.5 + * @since 3.2.6-RC1 */ $vars = array( 'sql_ary', @@ -598,7 +598,7 @@ switch ($mode) * @event core.modify_memberlist_viewprofile_group_data * @var array group_data Array containing the group data * @var array group_sort Array containing the sorted group data - * @since 3.2.5 + * @since 3.2.6-RC1 */ $vars = array( 'group_data', From 14f9917db60b88bbf2d4d9923e2a2cee5766bbec Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sun, 23 Dec 2018 14:35:58 +0100 Subject: [PATCH 25/61] [ticket/15919] Don't run lint test against node_modules Also, make sure to correctly handle opendir returning false instead of the stream handle. PHPBB3-15919 --- tests/lint_test.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/lint_test.php b/tests/lint_test.php index 70046bdfd2..8ab31f976c 100644 --- a/tests/lint_test.php +++ b/tests/lint_test.php @@ -67,6 +67,12 @@ class phpbb_lint_test extends phpbb_test_case { $files = array(); $dh = opendir($root); + + if ($dh === false) + { + return $files; + } + while (($filename = readdir($dh)) !== false) { if ($filename == '.' || $filename == '..') @@ -89,6 +95,7 @@ class phpbb_lint_test extends phpbb_test_case // PHP Fatal error: Cannot declare class Container because the name is already in use in /var/www/projects/phpbb3/tests/../phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services1-1.php on line 20 // https://gist.github.com/e003913ffd493da63cbc dirname(__FILE__) . '/../phpBB/vendor', + dirname(__FILE__) . '/../node_modules', ))) { $files = array_merge($files, $this->check($path)); From 8f90b794570e520eec82fc8c1f87ae5c93696873 Mon Sep 17 00:00:00 2001 From: 3D-I Date: Mon, 24 Dec 2018 09:45:02 +0100 Subject: [PATCH 26/61] [ticket/15918] Remove redundant escape JS In mcp_ban.html and coherently use twig syntax PHPBB3-15918 --- phpBB/styles/prosilver/template/mcp_ban.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/phpBB/styles/prosilver/template/mcp_ban.html b/phpBB/styles/prosilver/template/mcp_ban.html index d953f1039f..f3b767f3e4 100644 --- a/phpBB/styles/prosilver/template/mcp_ban.html +++ b/phpBB/styles/prosilver/template/mcp_ban.html @@ -9,12 +9,12 @@ ban_give_reason[-1] = ''; - ban_length['{bans.BAN_ID}'] = '{bans.A_LENGTH}'; + ban_length['{bans.BAN_ID}'] = '{{ bans.A_LENGTH }}'; - ban_reason['{bans.BAN_ID}'] = '{{ bans.A_REASON | e('js') }}'; + ban_reason['{bans.BAN_ID}'] = '{{ bans.A_REASON }}'; - ban_give_reason['{bans.BAN_ID}'] = '{{ bans.A_GIVE_REASON | e('js') }}'; + ban_give_reason['{bans.BAN_ID}'] = '{{ bans.A_GIVE_REASON }}'; From 440fdfdffcc36d1483d3a86f3fc7a152fb9d7a63 Mon Sep 17 00:00:00 2001 From: 3D-I Date: Mon, 24 Dec 2018 11:56:30 +0100 Subject: [PATCH 27/61] [ticket/15918] Apply the Twig escape filter to not add-slashed contents PHPBB3-15918 --- phpBB/styles/prosilver/template/mcp_ban.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpBB/styles/prosilver/template/mcp_ban.html b/phpBB/styles/prosilver/template/mcp_ban.html index f3b767f3e4..86a322435d 100644 --- a/phpBB/styles/prosilver/template/mcp_ban.html +++ b/phpBB/styles/prosilver/template/mcp_ban.html @@ -11,10 +11,10 @@ ban_length['{bans.BAN_ID}'] = '{{ bans.A_LENGTH }}'; - ban_reason['{bans.BAN_ID}'] = '{{ bans.A_REASON }}'; + ban_reason['{bans.BAN_ID}'] = '{{ bans.REASON | e('js') }}'; - ban_give_reason['{bans.BAN_ID}'] = '{{ bans.A_GIVE_REASON }}'; + ban_give_reason['{bans.BAN_ID}'] = '{{ bans.GIVE_REASON | e('js') }}'; From d0541a644038673f1083d08b1cd32e8803beb8df Mon Sep 17 00:00:00 2001 From: 3D-I Date: Wed, 26 Dec 2018 22:19:34 +0100 Subject: [PATCH 28/61] [ticket/15884] Alphabetical order PHPBB3-15884 --- phpBB/docs/events.md | 82 ++++++++++++++++++++++---------------------- 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/phpBB/docs/events.md b/phpBB/docs/events.md index 34917c417e..8adb9a8788 100644 --- a/phpBB/docs/events.md +++ b/phpBB/docs/events.md @@ -1114,26 +1114,12 @@ mcp_warn_user_add_warning_field_before * Since: 3.1.0-RC4 * Purpose: Add content during warning a user - before add warning field. -memberlist_body_page_header_after +memberlist_body_group_desc_after === * Locations: + styles/prosilver/template/memberlist_body.html * Since: 3.2.6-RC1 -* Purpose: Add data after the page header. - -memberlist_body_page_title_before -=== -* Locations: - + styles/prosilver/template/memberlist_body.html -* Since: 3.2.6-RC1 -* Purpose: Add data before the page title. - -memberlist_body_group_name_before -=== -* Locations: - + styles/prosilver/template/memberlist_body.html -* Since: 3.2.6-RC1 -* Purpose: Add data before the group name in the group profile page. +* Purpose: Add data after the group description and type in the group profile page. memberlist_body_group_name_after === @@ -1142,19 +1128,12 @@ memberlist_body_group_name_after * Since: 3.2.6-RC1 * Purpose: Add data after the group name in the group profile page. -memberlist_body_group_desc_after +memberlist_body_group_name_before === * Locations: + styles/prosilver/template/memberlist_body.html * Since: 3.2.6-RC1 -* Purpose: Add data after the group description and type in the group profile page. - -memberlist_body_group_rank_before -=== -* Locations: - + styles/prosilver/template/memberlist_body.html -* Since: 3.2.6-RC1 -* Purpose: Add data before the group rank in the group profile page. +* Purpose: Add data before the group name in the group profile page. memberlist_body_group_rank_after === @@ -1163,6 +1142,13 @@ memberlist_body_group_rank_after * Since: 3.2.6-RC1 * Purpose: Add data after the group rank in the group profile page. +memberlist_body_group_rank_before +=== +* Locations: + + styles/prosilver/template/memberlist_body.html +* Since: 3.2.6-RC1 +* Purpose: Add data before the group rank in the group profile page. + memberlist_body_memberlist_after === * Locations: @@ -1177,12 +1163,33 @@ memberlist_body_leaders_set_after * Since: 3.2.6-RC1 * Purpose: Add data after the last row in the memberlist mode leaders. -memberlist_body_show_group_after +memberlist_body_memberrow_after === * Locations: + styles/prosilver/template/memberlist_body.html * Since: 3.2.6-RC1 -* Purpose: Add data after the last row in the memberlist mode group. +* Purpose: Add data after the last memberrow in the memberlist. + +memberlist_body_page_footer_before +=== +* Locations: + + styles/prosilver/template/memberlist_body.html +* Since: 3.2.6-RC1 +* Purpose: Add data before the page footer. + +memberlist_body_page_header_after +=== +* Locations: + + styles/prosilver/template/memberlist_body.html +* Since: 3.2.6-RC1 +* Purpose: Add data after the page header. + +memberlist_body_page_title_before +=== +* Locations: + + styles/prosilver/template/memberlist_body.html +* Since: 3.2.6-RC1 +* Purpose: Add data before the page title. memberlist_body_rank_append === @@ -1200,6 +1207,13 @@ memberlist_body_rank_prepend * Purpose: Add information before rank in memberlist. Works in all display modes (leader, group and normal memberlist). +memberlist_body_show_group_after +=== +* Locations: + + styles/prosilver/template/memberlist_body.html +* Since: 3.2.6-RC1 +* Purpose: Add data after the last row in the memberlist mode group. + memberlist_body_username_append === * Locations: @@ -1216,20 +1230,6 @@ memberlist_body_username_prepend * Purpose: Add information before every username in the memberlist. Works in all display modes (leader, group and normal memberlist). -memberlist_body_memberrow_after -=== -* Locations: - + styles/prosilver/template/memberlist_body.html -* Since: 3.2.6-RC1 -* Purpose: Add data after the last memberrow in the memberlist. - -memberlist_body_page_footer_before -=== -* Locations: - + styles/prosilver/template/memberlist_body.html -* Since: 3.2.6-RC1 -* Purpose: Add data before the page footer. - memberlist_email_before === * Locations: From 4fe2ec156c9864624b7a25136c79f790e1427d4d Mon Sep 17 00:00:00 2001 From: 3D-I Date: Wed, 26 Dec 2018 22:24:47 +0100 Subject: [PATCH 29/61] [ticket/15884] Alphabetical order - last bit PHPBB3-15884 --- phpBB/docs/events.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/phpBB/docs/events.md b/phpBB/docs/events.md index 8adb9a8788..f980798bac 100644 --- a/phpBB/docs/events.md +++ b/phpBB/docs/events.md @@ -1149,13 +1149,6 @@ memberlist_body_group_rank_before * Since: 3.2.6-RC1 * Purpose: Add data before the group rank in the group profile page. -memberlist_body_memberlist_after -=== -* Locations: - + styles/prosilver/template/memberlist_body.html -* Since: 3.2.6-RC1 -* Purpose: Add data after the last row in the memberlist. - memberlist_body_leaders_set_after === * Locations: @@ -1163,6 +1156,13 @@ memberlist_body_leaders_set_after * Since: 3.2.6-RC1 * Purpose: Add data after the last row in the memberlist mode leaders. +memberlist_body_memberlist_after +=== +* Locations: + + styles/prosilver/template/memberlist_body.html +* Since: 3.2.6-RC1 +* Purpose: Add data after the last row in the memberlist. + memberlist_body_memberrow_after === * Locations: From 31c04668156638017a1c211100d7b86e5faff4d4 Mon Sep 17 00:00:00 2001 From: JoshyPHP Date: Mon, 24 Dec 2018 02:27:45 +0100 Subject: [PATCH 30/61] [ticket/15921] Updated dependencies to latest textformatter PHPBB3-15921 --- phpBB/composer.json | 2 +- phpBB/composer.lock | 27 +++++++++---------- phpBB/phpbb/textformatter/s9e/link_helper.php | 25 +++++++---------- .../s9e/default_formatting_test.php | 2 +- .../tickets_data/PHPBB3-15348.html | 2 +- 5 files changed, 26 insertions(+), 32 deletions(-) diff --git a/phpBB/composer.json b/phpBB/composer.json index 4f796a9dcb..d192fd57c8 100644 --- a/phpBB/composer.json +++ b/phpBB/composer.json @@ -33,7 +33,7 @@ "marc1706/fast-image-size": "^1.1", "paragonie/random_compat": "^1.4", "patchwork/utf8": "^1.1", - "s9e/text-formatter": "~0.13.0", + "s9e/text-formatter": "^1.3", "symfony/config": "^2.8", "symfony/console": "^2.8", "symfony/debug": "^2.8", diff --git a/phpBB/composer.lock b/phpBB/composer.lock index d235568697..ff5e10f271 100644 --- a/phpBB/composer.lock +++ b/phpBB/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "c843abc1344cd9df37f63c08a125cad0", + "content-hash": "6daa2f5f7a161377dee1835bd4d5b463", "packages": [ { "name": "bantu/ini-get-wrapper", @@ -342,7 +342,7 @@ "oauth", "security" ], - "time": "2016-07-12T22:15:00+00:00" + "time": "2018-02-14T22:37:14+00:00" }, { "name": "marc1706/fast-image-size", @@ -505,7 +505,7 @@ "pseudorandom", "random" ], - "time": "2017-03-13T16:22:52+00:00" + "time": "2018-04-04T21:48:54+00:00" }, { "name": "patchwork/utf8", @@ -661,16 +661,16 @@ }, { "name": "s9e/text-formatter", - "version": "0.13.1", + "version": "1.3.2", "source": { "type": "git", "url": "https://github.com/s9e/TextFormatter.git", - "reference": "804ed8fdfa9fd0c8d99f5a33000d4f7e5ed90c6f" + "reference": "640b65b0d4c1de93bc98000c003998c08b2e7256" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/s9e/TextFormatter/zipball/804ed8fdfa9fd0c8d99f5a33000d4f7e5ed90c6f", - "reference": "804ed8fdfa9fd0c8d99f5a33000d4f7e5ed90c6f", + "url": "https://api.github.com/repos/s9e/TextFormatter/zipball/640b65b0d4c1de93bc98000c003998c08b2e7256", + "reference": "640b65b0d4c1de93bc98000c003998c08b2e7256", "shasum": "" }, "require": { @@ -681,8 +681,8 @@ }, "require-dev": { "matthiasmullie/minify": "*", - "php": ">=5.4.7", - "s9e/regexp-builder": ">=1.3.0" + "php-coveralls/php-coveralls": "*", + "s9e/regexp-builder": "1.*" }, "suggest": { "ext-curl": "Improves the performance of the MediaEmbed plugin and some JavaScript minifiers", @@ -722,7 +722,7 @@ "parser", "shortcodes" ], - "time": "2017-12-10T00:55:53+00:00" + "time": "2018-12-23T20:27:39+00:00" }, { "name": "symfony/config", @@ -2293,7 +2293,8 @@ "authors": [ { "name": "Michiel Rook", - "email": "mrook@php.net" + "email": "mrook@php.net", + "role": "Lead" }, { "name": "Phing Community", @@ -2891,9 +2892,7 @@ "authors": [ { "name": "Fabien Potencier", - "email": "fabien@symfony.com", - "homepage": "http://fabien.potencier.org", - "role": "Lead Developer" + "email": "fabien@symfony.com" } ], "description": "Pimple is a simple Dependency Injection Container for PHP 5.3", diff --git a/phpBB/phpbb/textformatter/s9e/link_helper.php b/phpBB/phpbb/textformatter/s9e/link_helper.php index 0f44603dec..1e113b6449 100644 --- a/phpBB/phpbb/textformatter/s9e/link_helper.php +++ b/phpBB/phpbb/textformatter/s9e/link_helper.php @@ -23,14 +23,16 @@ class link_helper * * @param \s9e\TextFormatter\Parser\Tag $tag LINK_TEXT tag * @param \s9e\TextFormatter\Parser $parser Parser - * @return bool Whether the tag is valid + * @return void */ public function cleanup_tag(\s9e\TextFormatter\Parser\Tag $tag, \s9e\TextFormatter\Parser $parser) { // Invalidate if the content of the tag matches the text attribute $text = substr($parser->getText(), $tag->getPos(), $tag->getLen()); - - return ($text !== $tag->getAttribute('text')); + if ($text === $tag->getAttribute('text')) + { + $tag->invalidate(); + } } /** @@ -40,7 +42,7 @@ class link_helper * * @param \s9e\TextFormatter\Parser\Tag $tag URL tag (start tag) * @param \s9e\TextFormatter\Parser $parser Parser - * @return bool Always true to indicate that the tag is valid + * @return void */ public function generate_link_text_tag(\s9e\TextFormatter\Parser\Tag $tag, \s9e\TextFormatter\Parser $parser) { @@ -49,7 +51,7 @@ class link_helper // the [url] BBCode when its content is used for the URL if (!$tag->getEndTag() || !$this->should_shorten($tag, $parser->getText())) { - return true; + return; } // Capture the text between the start tag and its end tag @@ -60,8 +62,6 @@ class link_helper // Create a tag that consumes the link's text $parser->addSelfClosingTag('LINK_TEXT', $start, $length)->setAttribute('text', $text); - - return true; } /** @@ -84,7 +84,7 @@ class link_helper * * @param \s9e\TextFormatter\Parser\Tag $tag LINK_TEXT tag * @param string $board_url Forum's root URL (with trailing slash) - * @return bool Always true to indicate that the tag is valid + * @return void */ public function truncate_local_url(\s9e\TextFormatter\Parser\Tag $tag, $board_url) { @@ -93,15 +93,13 @@ class link_helper { $tag->setAttribute('text', substr($text, strlen($board_url))); } - - return true; } /** * Truncate the replacement text set in a LINK_TEXT tag * * @param \s9e\TextFormatter\Parser\Tag $tag LINK_TEXT tag - * @return bool Always true to indicate that the tag is valid + * @return void */ public function truncate_text(\s9e\TextFormatter\Parser\Tag $tag) { @@ -109,10 +107,7 @@ class link_helper if (utf8_strlen($text) > 55) { $text = utf8_substr($text, 0, 39) . ' ... ' . utf8_substr($text, -10); + $tag->setAttribute('text', $text); } - - $tag->setAttribute('text', $text); - - return true; } } diff --git a/tests/text_formatter/s9e/default_formatting_test.php b/tests/text_formatter/s9e/default_formatting_test.php index 8887b9daee..abaf55f374 100644 --- a/tests/text_formatter/s9e/default_formatting_test.php +++ b/tests/text_formatter/s9e/default_formatting_test.php @@ -298,7 +298,7 @@ class phpbb_textformatter_s9e_default_formatting_test extends phpbb_test_case ), array( "Emoji: \xF0\x9F\x98\x80", - 'Emoji: ' . ' + 'Emoji: ' . ' ), array( "Emoji: \xF0\x9F\x98\x80", diff --git a/tests/text_processing/tickets_data/PHPBB3-15348.html b/tests/text_processing/tickets_data/PHPBB3-15348.html index 5d44c07899..3ebe9aac88 100644 --- a/tests/text_processing/tickets_data/PHPBB3-15348.html +++ b/tests/text_processing/tickets_data/PHPBB3-15348.html @@ -1 +1 @@ -:o k: :ok: \ No newline at end of file +:o k: :ok: \ No newline at end of file From ce90a215ba23ca33f210e369b0fba7a2a49b3a85 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Wed, 26 Dec 2018 23:09:05 +0100 Subject: [PATCH 31/61] [ticket/15921] Update inconsistencies in composer.lock PHPBB3-15921 --- phpBB/composer.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/phpBB/composer.lock b/phpBB/composer.lock index ff5e10f271..a80bac724e 100644 --- a/phpBB/composer.lock +++ b/phpBB/composer.lock @@ -342,7 +342,7 @@ "oauth", "security" ], - "time": "2018-02-14T22:37:14+00:00" + "time": "2016-07-12T22:15:00+00:00" }, { "name": "marc1706/fast-image-size", @@ -505,7 +505,7 @@ "pseudorandom", "random" ], - "time": "2018-04-04T21:48:54+00:00" + "time": "2017-03-13T16:22:52+00:00" }, { "name": "patchwork/utf8", @@ -2293,8 +2293,7 @@ "authors": [ { "name": "Michiel Rook", - "email": "mrook@php.net", - "role": "Lead" + "email": "mrook@php.net" }, { "name": "Phing Community", @@ -2479,6 +2478,7 @@ "testing", "xunit" ], + "abandoned": true, "time": "2015-03-29T14:23:04+00:00" }, { From 4bf485395e2f66bc1aa8bfc9fde458c450238cb9 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Wed, 26 Dec 2018 23:41:27 +0100 Subject: [PATCH 32/61] [ticket/15921] Use twemoji PHPBB3-15921 --- phpBB/docs/CREDITS.txt | 3 +++ phpBB/phpbb/textformatter/s9e/factory.php | 1 + 2 files changed, 4 insertions(+) diff --git a/phpBB/docs/CREDITS.txt b/phpBB/docs/CREDITS.txt index fc089f9e02..90e9a31127 100644 --- a/phpBB/docs/CREDITS.txt +++ b/phpBB/docs/CREDITS.txt @@ -104,3 +104,6 @@ Text_Diff-0.2.1 http://pear.php.net/package/Text_Diff MIT licenced: Symfony2 (c) 2004-2011 Fabien Potencier, https://symfony.com/ Cookie Consent (c) 2015 Silktide Ltd, https://cookieconsent.insites.com + +Emoji by: +Twemoji (c) 2018 Twitter, Inc, https://twemoji.twitter.com/ diff --git a/phpBB/phpbb/textformatter/s9e/factory.php b/phpBB/phpbb/textformatter/s9e/factory.php index c0bbc7b0e8..d491a7180b 100644 --- a/phpBB/phpbb/textformatter/s9e/factory.php +++ b/phpBB/phpbb/textformatter/s9e/factory.php @@ -354,6 +354,7 @@ class factory implements \phpbb\textformatter\cache_interface // Load the Emoji plugin and modify its tag's template to obey viewsmilies $tag = $configurator->Emoji->getTag(); + $tag->template = '{.}'; $tag->template = '' . str_replace('class="emoji"', 'class="emoji smilies"', $tag->template) . ''; /** From 572545a430f9072915466acacf13d30b873e2255 Mon Sep 17 00:00:00 2001 From: Jakub Senko Date: Mon, 19 Nov 2018 15:33:57 +0100 Subject: [PATCH 33/61] [ticket/15899] Add core.modify_attachment_sql_ary_on_* events PHPBB3-15899 --- phpBB/includes/message_parser.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php index d67bc69591..703912236d 100644 --- a/phpBB/includes/message_parser.php +++ b/phpBB/includes/message_parser.php @@ -1587,6 +1587,16 @@ class parse_message extends bbcode_firstpass 'poster_id' => $user->data['user_id'], ); + /** + * Modify attachment sql array on submit + * + * @event core.modify_attachment_sql_ary_on_submit + * @var array sql_ary Array containing SQL data + * @since 3.2.6-RC1 + */ + $vars = array('sql_ary'); + extract($phpbb_dispatcher->trigger_event('core.modify_attachment_sql_ary_on_submit', compact($vars))); + $db->sql_query('INSERT INTO ' . ATTACHMENTS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary)); $new_entry = array( @@ -1722,6 +1732,16 @@ class parse_message extends bbcode_firstpass 'poster_id' => $user->data['user_id'], ); + /** + * Modify attachment sql array on upload + * + * @event core.modify_attachment_sql_ary_on_upload + * @var array sql_ary Array containing SQL data + * @since 3.2.6-RC1 + */ + $vars = array('sql_ary'); + extract($phpbb_dispatcher->trigger_event('core.modify_attachment_sql_ary_on_upload', compact($vars))); + $db->sql_query('INSERT INTO ' . ATTACHMENTS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary)); $new_entry = array( From c51859c0bdaf1997efb6a8d792628bd35165bfec Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Thu, 27 Dec 2018 10:36:41 +0100 Subject: [PATCH 34/61] [ticket/15921] Update tests for twemoji PHPBB3-15921 --- tests/text_formatter/s9e/default_formatting_test.php | 2 +- tests/text_processing/tickets_data/PHPBB3-15348.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/text_formatter/s9e/default_formatting_test.php b/tests/text_formatter/s9e/default_formatting_test.php index abaf55f374..05a41c5095 100644 --- a/tests/text_formatter/s9e/default_formatting_test.php +++ b/tests/text_formatter/s9e/default_formatting_test.php @@ -298,7 +298,7 @@ class phpbb_textformatter_s9e_default_formatting_test extends phpbb_test_case ), array( "Emoji: \xF0\x9F\x98\x80", - 'Emoji: ' . ' + 'Emoji: ' . ' ), array( "Emoji: \xF0\x9F\x98\x80", diff --git a/tests/text_processing/tickets_data/PHPBB3-15348.html b/tests/text_processing/tickets_data/PHPBB3-15348.html index 3ebe9aac88..1794232d08 100644 --- a/tests/text_processing/tickets_data/PHPBB3-15348.html +++ b/tests/text_processing/tickets_data/PHPBB3-15348.html @@ -1 +1 @@ -:o k: :ok: \ No newline at end of file +:o k: :ok: \ No newline at end of file From e9310c928e8531a560d3034dba2db1a0d2f9a395 Mon Sep 17 00:00:00 2001 From: JoshyPHP Date: Sat, 29 Dec 2018 11:12:04 +0100 Subject: [PATCH 35/61] [ticket/15921] Use backward compatible template for emojis PHPBB3-15921 --- phpBB/phpbb/textformatter/s9e/factory.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/phpBB/phpbb/textformatter/s9e/factory.php b/phpBB/phpbb/textformatter/s9e/factory.php index d491a7180b..6191b9a315 100644 --- a/phpBB/phpbb/textformatter/s9e/factory.php +++ b/phpBB/phpbb/textformatter/s9e/factory.php @@ -354,7 +354,14 @@ class factory implements \phpbb\textformatter\cache_interface // Load the Emoji plugin and modify its tag's template to obey viewsmilies $tag = $configurator->Emoji->getTag(); - $tag->template = '{.}'; + $tag->template = ' + + {.} + + + {.} + + '; $tag->template = '' . str_replace('class="emoji"', 'class="emoji smilies"', $tag->template) . ''; /** From 444e5e6498c90c6c6e64f03d520b12eaf27b73db Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sun, 30 Dec 2018 23:19:01 +0100 Subject: [PATCH 36/61] [ticket/15924] Switch to trusty build environment PHPBB3-15924 --- .travis.yml | 4 ++- travis/setup-mariadb.sh | 54 --------------------------------------- travis/setup-phpbb.sh | 5 ---- travis/setup-webserver.sh | 7 +++-- 4 files changed, 8 insertions(+), 62 deletions(-) delete mode 100755 travis/setup-mariadb.sh diff --git a/.travis.yml b/.travis.yml index 91b8b4932c..839497f2ff 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,5 @@ language: php sudo: required -dist: precise matrix: include: @@ -37,6 +36,9 @@ matrix: services: - redis-server +addons: + mariadb: '10.0' + install: - travis/setup-phpbb.sh $DB $TRAVIS_PHP_VERSION $NOTESTS diff --git a/travis/setup-mariadb.sh b/travis/setup-mariadb.sh deleted file mode 100755 index 9bc487915d..0000000000 --- a/travis/setup-mariadb.sh +++ /dev/null @@ -1,54 +0,0 @@ -#!/bin/bash -# -# This file is part of the phpBB Forum Software package. -# -# @copyright (c) phpBB Limited -# @license GNU General Public License, version 2 (GPL-2.0) -# -# For full copyright and license information, please see -# the docs/CREDITS.txt file. -# -set -e -set -x - -# MariaDB Series -VERSION='5.5' - -# Operating system codename, e.g. "precise" -OS_CODENAME=$(lsb_release --codename --short) - -# Manually purge MySQL to remove conflicting files (e.g. /etc/mysql/my.cnf) -sudo apt-get purge -y mysql-common - -if ! which add-apt-repository > /dev/null -then - sudo apt-get update - sudo apt-get install -y python-software-properties -fi - -MIRROR_DOMAIN='ftp.osuosl.org' -sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xcbcb082a1bb943db -sudo add-apt-repository "deb http://$MIRROR_DOMAIN/pub/mariadb/repo/$VERSION/ubuntu $OS_CODENAME main" -sudo apt-get update - -# Pin repository in order to avoid conflicts with MySQL from distribution -# repository. See https://mariadb.com/kb/en/installing-mariadb-deb-files -# section "Version Mismatch Between MariaDB and Ubuntu/Debian Repositories" -echo " -Package: * -Pin: origin $MIRROR_DOMAIN -Pin-Priority: 1000 -" | sudo tee /etc/apt/preferences.d/mariadb - -sudo debconf-set-selections <<< "mariadb-server-$VERSION mysql-server/root_password password rootpasswd" -sudo debconf-set-selections <<< "mariadb-server-$VERSION mysql-server/root_password_again password rootpasswd" -sudo apt-get install -y mariadb-server - -# Set root password to empty string. -echo " -USE mysql; -UPDATE user SET Password = PASSWORD('') where User = 'root'; -FLUSH PRIVILEGES; -" | mysql -u root -prootpasswd - -mysql --version diff --git a/travis/setup-phpbb.sh b/travis/setup-phpbb.sh index be9eb703d5..98e9afa485 100755 --- a/travis/setup-phpbb.sh +++ b/travis/setup-phpbb.sh @@ -21,11 +21,6 @@ then travis/setup-unbuffer.sh fi -if [ "$DB" == "mariadb" ] -then - travis/setup-mariadb.sh -fi - if [ "$NOTESTS" != '1' ] then travis/setup-php-extensions.sh diff --git a/travis/setup-webserver.sh b/travis/setup-webserver.sh index 7fb67e0454..f4e78124d8 100755 --- a/travis/setup-webserver.sh +++ b/travis/setup-webserver.sh @@ -19,7 +19,8 @@ sudo service nginx stop DIR=$(dirname "$0") USER=$(whoami) PHPBB_ROOT_PATH=$(realpath "$DIR/../phpBB") -NGINX_CONF="/etc/nginx/sites-enabled/default" +NGINX_SITE_CONF="/etc/nginx/sites-enabled/default" +NGINX_CONF="/etc/nginx/nginx.conf" APP_SOCK=$(realpath "$DIR")/php-app.sock # php-fpm @@ -50,6 +51,8 @@ cat $DIR/../phpBB/docs/nginx.sample.conf \ | sed -e '/If running php as fastcgi/,$d' \ | sed -e "s/fastcgi_pass php;/fastcgi_pass unix:$(echo $APP_SOCK | sed -e 's/\\/\\\\/g' -e 's/\//\\\//g' -e 's/&/\\\&/g');/g" \ | sed -e 's/#listen 80/listen 80/' \ -| sudo tee $NGINX_CONF +| sudo tee $NGINX_SITE_CONF +sudo sed -i "s/user www-data;/user $USER;/g" $NGINX_CONF +sudo nginx -t sudo service nginx start From bdf9af0abbadcce51a47ba586a800eafe2093814 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Mon, 31 Dec 2018 23:15:29 +0100 Subject: [PATCH 37/61] [ticket/15924] Install apc via pecl and remove nginx config check PHPBB3-15924 --- travis/setup-php-extensions.sh | 2 +- travis/setup-webserver.sh | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/travis/setup-php-extensions.sh b/travis/setup-php-extensions.sh index d9544858b7..347d7b5773 100755 --- a/travis/setup-php-extensions.sh +++ b/travis/setup-php-extensions.sh @@ -46,7 +46,7 @@ php_ini_file=$(find_php_ini) if [ `php -r "echo (int) version_compare(PHP_VERSION, '5.5.0-dev', '<');"` == "1" ] then echo 'Enabling APC PHP extension' - register_php_extension 'apc' "$php_ini_file" + printf "\n" | pecl install apc echo 'apc.enable_cli=1' >> "$php_ini_file" else echo 'Disabling Opcache' diff --git a/travis/setup-webserver.sh b/travis/setup-webserver.sh index f4e78124d8..fd87d97449 100755 --- a/travis/setup-webserver.sh +++ b/travis/setup-webserver.sh @@ -54,5 +54,4 @@ cat $DIR/../phpBB/docs/nginx.sample.conf \ | sudo tee $NGINX_SITE_CONF sudo sed -i "s/user www-data;/user $USER;/g" $NGINX_CONF -sudo nginx -t sudo service nginx start From a23a7602b7d550616a8fb83316a33ffb6e924487 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Tue, 1 Jan 2019 10:03:08 +0100 Subject: [PATCH 38/61] [ticket/15924] Enable APCu extension PHPBB3-15924 --- travis/setup-php-extensions.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/travis/setup-php-extensions.sh b/travis/setup-php-extensions.sh index 347d7b5773..918f67cd47 100755 --- a/travis/setup-php-extensions.sh +++ b/travis/setup-php-extensions.sh @@ -53,6 +53,16 @@ else echo 'opcache.enable=0' >> "$php_ini_file" fi +# APCu +if [ `php -r "echo (int) (version_compare(PHP_VERSION, '7.0.0-dev', '>=') && version_compare(PHP_VERSION, '7.3.0-dev', '<'));"` == "1" ] +then + echo 'Enabling APCu PHP extension' + printf "\n" | pecl install apcu + echo 'apc.enabled=1' >> "$php_ini_file" + echo 'apc.enable_cli=1' >> "$php_ini_file" +fi + + # redis # Disabled redis for now as it causes travis to fail # git clone git://github.com/nicolasff/phpredis.git redis From 186115c65feccedb659c6a4fecd3d4ea437835da Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Tue, 1 Jan 2019 22:21:25 +0100 Subject: [PATCH 39/61] [ticket/15924] Switch back to installing mariadb from 3rd party repo PHPBB3-15924 --- .travis.yml | 3 --- travis/setup-mariadb.sh | 54 +++++++++++++++++++++++++++++++++++++++++ travis/setup-phpbb.sh | 5 ++++ 3 files changed, 59 insertions(+), 3 deletions(-) create mode 100755 travis/setup-mariadb.sh diff --git a/.travis.yml b/.travis.yml index 839497f2ff..cb574a4d8d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -36,9 +36,6 @@ matrix: services: - redis-server -addons: - mariadb: '10.0' - install: - travis/setup-phpbb.sh $DB $TRAVIS_PHP_VERSION $NOTESTS diff --git a/travis/setup-mariadb.sh b/travis/setup-mariadb.sh new file mode 100755 index 0000000000..95445dcc55 --- /dev/null +++ b/travis/setup-mariadb.sh @@ -0,0 +1,54 @@ +#!/bin/bash +# +# This file is part of the phpBB Forum Software package. +# +# @copyright (c) phpBB Limited +# @license GNU General Public License, version 2 (GPL-2.0) +# +# For full copyright and license information, please see +# the docs/CREDITS.txt file. +# +set -e +set -x + +# MariaDB Series +VERSION='10.0' + +# Operating system codename, e.g. "precise" +OS_CODENAME=$(lsb_release --codename --short) + +# Manually purge MySQL to remove conflicting files (e.g. /etc/mysql/my.cnf) +sudo apt-get purge -y mysql-common + +if ! which add-apt-repository > /dev/null +then + sudo apt-get update + sudo apt-get install -y python-software-properties +fi + +MIRROR_DOMAIN='ftp.osuosl.org' +sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xcbcb082a1bb943db +sudo add-apt-repository "deb http://$MIRROR_DOMAIN/pub/mariadb/repo/$VERSION/ubuntu $OS_CODENAME main" +sudo apt-get update + +# Pin repository in order to avoid conflicts with MySQL from distribution +# repository. See https://mariadb.com/kb/en/installing-mariadb-deb-files +# section "Version Mismatch Between MariaDB and Ubuntu/Debian Repositories" +echo " +Package: * +Pin: origin $MIRROR_DOMAIN +Pin-Priority: 1000 +" | sudo tee /etc/apt/preferences.d/mariadb + +sudo debconf-set-selections <<< "mariadb-server-$VERSION mysql-server/root_password password rootpasswd" +sudo debconf-set-selections <<< "mariadb-server-$VERSION mysql-server/root_password_again password rootpasswd" +sudo apt-get install -y mariadb-server + +# Set root password to empty string. +echo " +USE mysql; +UPDATE user SET Password = PASSWORD('') where User = 'root'; +FLUSH PRIVILEGES; +" | mysql -u root -prootpasswd + +mysql --version diff --git a/travis/setup-phpbb.sh b/travis/setup-phpbb.sh index 98e9afa485..be9eb703d5 100755 --- a/travis/setup-phpbb.sh +++ b/travis/setup-phpbb.sh @@ -21,6 +21,11 @@ then travis/setup-unbuffer.sh fi +if [ "$DB" == "mariadb" ] +then + travis/setup-mariadb.sh +fi + if [ "$NOTESTS" != '1' ] then travis/setup-php-extensions.sh From 3f19d32f768974454046f744f126515fb3747b99 Mon Sep 17 00:00:00 2001 From: battye Date: Fri, 4 Jan 2019 15:49:15 +0000 Subject: [PATCH 40/61] [ticket/15883] Review changes PHPBB3-15883 --- phpBB/includes/acp/acp_groups.php | 2 +- phpBB/includes/functions_user.php | 1 + phpBB/includes/ucp/ucp_groups.php | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/phpBB/includes/acp/acp_groups.php b/phpBB/includes/acp/acp_groups.php index f541025bf2..7b1dc706db 100644 --- a/phpBB/includes/acp/acp_groups.php +++ b/phpBB/includes/acp/acp_groups.php @@ -302,7 +302,7 @@ class acp_groups { // Find which users don't exist $actual_name_ary = $name_ary; - $actual_user_id_ary = false; + $actual_user_id_ary = []; user_get_id_name($actual_user_id_ary, $actual_name_ary, false, true); $display_message = $language->lang('GROUP_USERS_INVALID', implode($language->lang('COMMA_SEPARATOR'), array_udiff($name_ary, $actual_name_ary, 'strcasecmp'))); diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index e998ffdab9..2be9d089a5 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -27,6 +27,7 @@ if (!defined('IN_PHPBB')) * @param array &$username_ary The usernames to check or empty if user ids used * @param mixed $user_type Array of user types to check, false if not restricting by user type * @param bool $update_references If false, the supplied array is unset and appears unchanged from where it was called +* @return null */ function user_get_id_name(&$user_id_ary, &$username_ary, $user_type = false, $update_references = false) { diff --git a/phpBB/includes/ucp/ucp_groups.php b/phpBB/includes/ucp/ucp_groups.php index d0ac598920..4673912aed 100644 --- a/phpBB/includes/ucp/ucp_groups.php +++ b/phpBB/includes/ucp/ucp_groups.php @@ -1068,7 +1068,7 @@ class ucp_groups { // Find which users don't exist $actual_name_ary = $name_ary; - $actual_user_id_ary = false; + $actual_user_id_ary = []; user_get_id_name($actual_user_id_ary, $actual_name_ary, false, true); $display_message = $language->lang('GROUP_USERS_INVALID', implode($language->lang('COMMA_SEPARATOR'), array_udiff($name_ary, $actual_name_ary, 'strcasecmp'))); From 5949f912ba429c05109c5814f5efc85ff8872d02 Mon Sep 17 00:00:00 2001 From: 3D-I Date: Sat, 5 Jan 2019 01:32:43 +0100 Subject: [PATCH 41/61] [ticket/15926] Deny 3.2.x installation if PHP >= 7.3-dev PHPBB3-15926 --- phpBB/install/app.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpBB/install/app.php b/phpBB/install/app.php index ef59689a65..ef29bd5722 100644 --- a/phpBB/install/app.php +++ b/phpBB/install/app.php @@ -20,9 +20,9 @@ define('PHPBB_ENVIRONMENT', 'production'); $phpbb_root_path = '../'; $phpEx = substr(strrchr(__FILE__, '.'), 1); -if (version_compare(PHP_VERSION, '5.4') < 0) +if ( version_compare(PHP_VERSION, '5.4.7', '<') || version_compare(PHP_VERSION, '7.3-dev', '>=') ) { - die('You are running an unsupported PHP version. Please upgrade to PHP 5.4.0 or higher before trying to install or update to phpBB 3.2'); + die('You are running an unsupported PHP version. Please upgrade to PHP equal or greater than 5.4.7 but less than 7.3-dev in order to install or update to phpBB 3.2'); } $startup_new_path = $phpbb_root_path . 'install/update/update/new/install/startup.' . $phpEx; From 08968bdb60c9ff286cb71901718500c7720f1da4 Mon Sep 17 00:00:00 2001 From: battye Date: Sat, 5 Jan 2019 08:19:21 +0000 Subject: [PATCH 42/61] [ticket/15883] Doc block change PHPBB3-15883 --- phpBB/includes/functions_user.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index 2be9d089a5..71c4f41817 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -26,8 +26,8 @@ if (!defined('IN_PHPBB')) * @param array &$user_id_ary The user ids to check or empty if usernames used * @param array &$username_ary The usernames to check or empty if user ids used * @param mixed $user_type Array of user types to check, false if not restricting by user type -* @param bool $update_references If false, the supplied array is unset and appears unchanged from where it was called -* @return null +* @param boolean $update_references If false, the supplied array is unset and appears unchanged from where it was called +* @return boolean|string Returns false on success, error string on failure */ function user_get_id_name(&$user_id_ary, &$username_ary, $user_type = false, $update_references = false) { From 8fa7e18e2bc059f592c4f77d4ad7c3dd2e310fb1 Mon Sep 17 00:00:00 2001 From: 3D-I Date: Sat, 5 Jan 2019 18:35:28 +0100 Subject: [PATCH 43/61] [ticket/15926] Deny 3.2.x installation if PHP >= 7.3-dev PHPBB3-15926 --- phpBB/install/app.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/install/app.php b/phpBB/install/app.php index ef29bd5722..b4adf0431a 100644 --- a/phpBB/install/app.php +++ b/phpBB/install/app.php @@ -20,7 +20,7 @@ define('PHPBB_ENVIRONMENT', 'production'); $phpbb_root_path = '../'; $phpEx = substr(strrchr(__FILE__, '.'), 1); -if ( version_compare(PHP_VERSION, '5.4.7', '<') || version_compare(PHP_VERSION, '7.3-dev', '>=') ) +if (version_compare(PHP_VERSION, '5.4.7', '<') || version_compare(PHP_VERSION, '7.3-dev', '>=')) { die('You are running an unsupported PHP version. Please upgrade to PHP equal or greater than 5.4.7 but less than 7.3-dev in order to install or update to phpBB 3.2'); } From be0696a954bc248b8a6e38ebcb9b5f91f46f1636 Mon Sep 17 00:00:00 2001 From: 3D-I Date: Sat, 5 Jan 2019 18:56:40 +0100 Subject: [PATCH 44/61] [ticket/15926] Update docs/INSTALL.html PHPBB3-15926 --- phpBB/docs/INSTALL.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/docs/INSTALL.html b/phpBB/docs/INSTALL.html index 853607886b..4f7f07d3dc 100644 --- a/phpBB/docs/INSTALL.html +++ b/phpBB/docs/INSTALL.html @@ -147,7 +147,7 @@
  • Oracle
  • -
  • PHP 5.4.7+ with support for the database you intend to use.
  • +
  • PHP 5.4.7+ but less than PHP 7.3 with support for the database you intend to use.
  • The following PHP modules are required:
    • json
    • From a0efae7734dffad160aed7684a3b4072a5dbec69 Mon Sep 17 00:00:00 2001 From: 3D-I Date: Sun, 6 Jan 2019 00:08:49 +0100 Subject: [PATCH 45/61] [ticket/15926] Deny 3.2.x installation if PHP >= 7.3-dev PHPBB3-15926 --- phpBB/install/app.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/install/app.php b/phpBB/install/app.php index b4adf0431a..710f49570b 100644 --- a/phpBB/install/app.php +++ b/phpBB/install/app.php @@ -22,7 +22,7 @@ $phpEx = substr(strrchr(__FILE__, '.'), 1); if (version_compare(PHP_VERSION, '5.4.7', '<') || version_compare(PHP_VERSION, '7.3-dev', '>=')) { - die('You are running an unsupported PHP version. Please upgrade to PHP equal or greater than 5.4.7 but less than 7.3-dev in order to install or update to phpBB 3.2'); + die('You are running an unsupported PHP version. Please upgrade to PHP equal to or greater than 5.4.7 but less than 7.3-dev in order to install or update to phpBB 3.2'); } $startup_new_path = $phpbb_root_path . 'install/update/update/new/install/startup.' . $phpEx; From ec3bab231d63cef251ad0d1402c45d94fcfc07c1 Mon Sep 17 00:00:00 2001 From: Alec Date: Sat, 12 Jan 2019 15:21:43 -0500 Subject: [PATCH 46/61] [ticket/15935] Don't install APCu if it's already installed Travis fails when the APCu install fails due to it already being installed A check is added here to make sure that it does nothing in that case PHPBB3-15935 --- travis/setup-php-extensions.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/travis/setup-php-extensions.sh b/travis/setup-php-extensions.sh index 918f67cd47..de27965e39 100755 --- a/travis/setup-php-extensions.sh +++ b/travis/setup-php-extensions.sh @@ -56,10 +56,13 @@ fi # APCu if [ `php -r "echo (int) (version_compare(PHP_VERSION, '7.0.0-dev', '>=') && version_compare(PHP_VERSION, '7.3.0-dev', '<'));"` == "1" ] then - echo 'Enabling APCu PHP extension' - printf "\n" | pecl install apcu - echo 'apc.enabled=1' >> "$php_ini_file" - echo 'apc.enable_cli=1' >> "$php_ini_file" + if ! [ "$(pecl info pecl/apcu)" ] + then + echo 'Enabling APCu PHP extension' + printf "\n" | pecl install apcu + echo 'apc.enabled=1' >> "$php_ini_file" + echo 'apc.enable_cli=1' >> "$php_ini_file" + fi fi From 8d8dbb21296aba33a0bd23fb924af0e23d24b8c4 Mon Sep 17 00:00:00 2001 From: mrgoldy Date: Mon, 14 Jan 2019 12:50:07 +0100 Subject: [PATCH 47/61] [ticket/15939] Pagination docblocks PHPBB3-15939 --- phpBB/phpbb/pagination.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/phpBB/phpbb/pagination.php b/phpBB/phpbb/pagination.php index 40af5eda6b..a7086f6691 100644 --- a/phpBB/phpbb/pagination.php +++ b/phpBB/phpbb/pagination.php @@ -46,7 +46,7 @@ class pagination /** * Generate a pagination link based on the url and the page information * - * @param string $base_url is url prepended to all links generated within the function + * @param string|array $base_url is url prepended to all links generated within the function * If you use page numbers inside your controller route, base_url should contains a placeholder (%d) * for the page. Also be sure to specify the pagination path information into the start_name argument * @param string $on_page is the page for which we want to generate the link @@ -69,7 +69,7 @@ class pagination * set $generate_page_link_override to the new URL value * * @event core.pagination_generate_page_link - * @var string base_url is url prepended to all links generated within the function + * @var string|array base_url is url prepended to all links generated within the function * If you use page numbers inside your controller route, base_url should contains a placeholder (%d) * for the page. Also be sure to specify the pagination path information into the start_name argument * @var string on_page is the page for which we want to generate the link @@ -120,7 +120,7 @@ class pagination * Generate template rendered pagination * Allows full control of rendering of pagination with the template * - * @param string $base_url is url prepended to all links generated within the function + * @param string|array $base_url is url prepended to all links generated within the function * If you use page numbers inside your controller route, base_url should contains a placeholder (%d) * for the page. Also be sure to specify the pagination path information into the start_name argument * @param string $block_var_name is the name assigned to the pagination data block within the template (example: ) @@ -132,7 +132,7 @@ class pagination * @param int $start the item which should be considered currently active, used to determine the page we're on * @param bool $reverse_count determines whether we weight display of the list towards the start (false) or end (true) of the list * @param bool $ignore_on_page decides whether we enable an active (unlinked) item, used primarily for embedded lists - * @return null + * @return void */ public function generate_template_pagination($base_url, $block_var_name, $start_name, $num_items, $per_page, $start = 1, $reverse_count = false, $ignore_on_page = false) { From e8bbbbd6fac8a1f04bc74e9ada9df2f5ea83eb25 Mon Sep 17 00:00:00 2001 From: mrgoldy Date: Mon, 14 Jan 2019 14:52:06 +0100 Subject: [PATCH 48/61] [ticket/15931] Fix PM report emails PHPBB3-15931 --- phpBB/language/en/email/report_pm.txt | 2 +- phpBB/phpbb/notification/type/report_pm.php | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/phpBB/language/en/email/report_pm.txt b/phpBB/language/en/email/report_pm.txt index a101a014ff..a6b8086a9a 100644 --- a/phpBB/language/en/email/report_pm.txt +++ b/phpBB/language/en/email/report_pm.txt @@ -1,4 +1,4 @@ -Subject: Private Message report - "{TOPIC_TITLE}" +Subject: Private Message report - "{SUBJECT}" Hello {USERNAME}, diff --git a/phpBB/phpbb/notification/type/report_pm.php b/phpBB/phpbb/notification/type/report_pm.php index 7e53ffb3ca..444f98270d 100644 --- a/phpBB/phpbb/notification/type/report_pm.php +++ b/phpBB/phpbb/notification/type/report_pm.php @@ -142,13 +142,16 @@ class report_pm extends \phpbb\notification\type\pm */ public function get_email_template_variables() { - $user_data = $this->user_loader->get_user($this->get_data('reporter_id')); + $user_data = $this->user_loader->get_user($this->get_data('from_user_id')); return array( 'AUTHOR_NAME' => htmlspecialchars_decode($user_data['username']), 'SUBJECT' => htmlspecialchars_decode(censor_text($this->get_data('message_subject'))), - 'U_VIEW_REPORT' => generate_board_url() . "mcp.{$this->php_ext}?r={$this->item_parent_id}&i=pm_reports&mode=pm_report_details", + /** @deprecated 3.2.6-RC1 (to be removed in 4.0.0) use {SUBJECT} instead in report_pm.txt */ + 'TOPIC_TITLE' => htmlspecialchars_decode(censor_text($this->get_data('message_subject'))), + + 'U_VIEW_REPORT' => generate_board_url() . "/mcp.{$this->php_ext}?r={$this->item_parent_id}&i=pm_reports&mode=pm_report_details", ); } @@ -236,8 +239,10 @@ class report_pm extends \phpbb\notification\type\pm */ public function users_to_query() { - return array($this->get_data('reporter_id')); - } + return array( + $this->get_data('from_user_id'), + $this->get_data('reporter_id'), + ); } /** * {@inheritdoc} From cffdc8efff9f0c66e6640a42fc375b4662b44180 Mon Sep 17 00:00:00 2001 From: jasonmarlin Date: Tue, 15 Jan 2019 11:31:38 -0500 Subject: [PATCH 49/61] [ticket/15941] Replace MAX to speed up query in update_post_information Replace MAX SQL function with faster query using order by and limit. The ajacent query could also be optimized to eliminate the usage of MAX. Note that adding a compound key as suggested by EXPLAIN SQL yields an improvement, but not nearly as fast as ORDER + LIMIT. PHPBB3-15941 --- phpBB/includes/functions_posting.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index c7d691287c..3640f543d9 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -202,11 +202,13 @@ function update_post_information($type, $ids, $return_update_sql = false) if (count($ids) == 1) { - $sql = 'SELECT MAX(p.post_id) as last_post_id + $sql = 'SELECT p.post_id as last_post_id FROM ' . POSTS_TABLE . " p $topic_join WHERE " . $db->sql_in_set('p.' . $type . '_id', $ids) . " $topic_condition - AND p.post_visibility = " . ITEM_APPROVED; + AND p.post_visibility = " . ITEM_APPROVED . " + ORDER BY p.post_id DESC"; + $result = $db->sql_query_limit($sql, 1); } else { @@ -216,8 +218,8 @@ function update_post_information($type, $ids, $return_update_sql = false) $topic_condition AND p.post_visibility = " . ITEM_APPROVED . " GROUP BY p.{$type}_id"; + $result = $db->sql_query($sql); } - $result = $db->sql_query($sql); $last_post_ids = array(); while ($row = $db->sql_fetchrow($result)) From a0f1ec852a987fb587cc07dc6910000c925db50d Mon Sep 17 00:00:00 2001 From: jasonmarlin Date: Thu, 17 Jan 2019 20:27:10 -0500 Subject: [PATCH 50/61] [ticket/15941] Replace MAX SQL in functions_posting.php Replace MAX SQL function with faster query using order by and limit. The ajacent query could also be optimized to eliminate the usage of MAX. Note that adding a compound key as suggested by EXPLAIN SQL yields an improvement, but not nearly as fast as ORDER + LIMIT. PHPBB3-15941 --- phpBB/includes/functions_posting.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 3640f543d9..8ca483f53a 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -200,7 +200,7 @@ function update_post_information($type, $ids, $return_update_sql = false) $topic_condition = ''; } - if (count($ids) == 1) + if (count($ids) === 1) { $sql = 'SELECT p.post_id as last_post_id FROM ' . POSTS_TABLE . " p $topic_join From c43ad073e4902471637140dc782733da3b93bfa1 Mon Sep 17 00:00:00 2001 From: jasonmarlin Date: Fri, 18 Jan 2019 08:38:25 -0500 Subject: [PATCH 51/61] [ticket/15941] Small change to induce rebuild PHPBB3-15941 --- phpBB/includes/functions_posting.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 8ca483f53a..3640f543d9 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -200,7 +200,7 @@ function update_post_information($type, $ids, $return_update_sql = false) $topic_condition = ''; } - if (count($ids) === 1) + if (count($ids) == 1) { $sql = 'SELECT p.post_id as last_post_id FROM ' . POSTS_TABLE . " p $topic_join From ca4a98a2de7c20768e794eb62a519c920950823a Mon Sep 17 00:00:00 2001 From: 3D-I Date: Tue, 22 Jan 2019 16:10:52 +0100 Subject: [PATCH 52/61] [ticket/15950] Add SQL transactions to mcp_main.php PHPBB3-15950 And simultaneously remove a duplicated UPDATE query. --- phpBB/includes/mcp/mcp_main.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/phpBB/includes/mcp/mcp_main.php b/phpBB/includes/mcp/mcp_main.php index 196d2f995f..3c838e8d17 100644 --- a/phpBB/includes/mcp/mcp_main.php +++ b/phpBB/includes/mcp/mcp_main.php @@ -414,6 +414,8 @@ function change_topic_type($action, $topic_ids) if (confirm_box(true)) { + $db->sql_transaction('begin'); + $sql = 'UPDATE ' . TOPICS_TABLE . " SET topic_type = $new_topic_type WHERE " . $db->sql_in_set('topic_id', $topic_ids); @@ -425,13 +427,10 @@ function change_topic_type($action, $topic_ids) $sql = 'DELETE FROM ' . TOPICS_TABLE . ' WHERE ' . $db->sql_in_set('topic_moved_id', $topic_ids); $db->sql_query($sql); - - $sql = 'UPDATE ' . TOPICS_TABLE . " - SET topic_type = $new_topic_type - WHERE " . $db->sql_in_set('topic_id', $topic_ids); - $db->sql_query($sql); } + $db->sql_transaction('commit'); + $success_msg = (count($topic_ids) == 1) ? 'TOPIC_TYPE_CHANGED' : 'TOPICS_TYPE_CHANGED'; if (count($topic_ids)) From 75007697ae55632200eb7f2c6579026e23fe3d7d Mon Sep 17 00:00:00 2001 From: kasimi Date: Sat, 26 Jan 2019 22:29:54 +0100 Subject: [PATCH 53/61] [ticket/15954] Add safeguards to include() calls PHPBB3-15954 --- phpBB/includes/mcp/mcp_ban.php | 5 ++++- phpBB/includes/mcp/mcp_front.php | 5 ++++- phpBB/includes/mcp/mcp_main.php | 20 +++++++++++++---- phpBB/includes/mcp/mcp_topic.php | 6 +++++- phpBB/includes/ucp/ucp_groups.php | 5 ++++- phpBB/includes/ucp/ucp_main.php | 10 +++++++-- phpBB/includes/ucp/ucp_pm.php | 31 +++++++++++++++++++++------ phpBB/includes/ucp/ucp_pm_compose.php | 17 ++++++++++++--- phpBB/includes/ucp/ucp_profile.php | 11 ++++++++-- 9 files changed, 88 insertions(+), 22 deletions(-) diff --git a/phpBB/includes/mcp/mcp_ban.php b/phpBB/includes/mcp/mcp_ban.php index b878b1af0a..8797f06db8 100644 --- a/phpBB/includes/mcp/mcp_ban.php +++ b/phpBB/includes/mcp/mcp_ban.php @@ -34,7 +34,10 @@ class mcp_ban } // Include the admin banning interface... - include($phpbb_root_path . 'includes/acp/acp_ban.' . $phpEx); + if (!class_exists('acp_ban')) + { + include($phpbb_root_path . 'includes/acp/acp_ban.' . $phpEx); + } $bansubmit = $request->is_set_post('bansubmit'); $unbansubmit = $request->is_set_post('unbansubmit'); diff --git a/phpBB/includes/mcp/mcp_front.php b/phpBB/includes/mcp/mcp_front.php index aeb716c1f9..918a98734b 100644 --- a/phpBB/includes/mcp/mcp_front.php +++ b/phpBB/includes/mcp/mcp_front.php @@ -290,7 +290,10 @@ function mcp_front_view($id, $mode, $action) if ($total) { - include($phpbb_root_path . 'includes/functions_privmsgs.' . $phpEx); + if (!function_exists('get_recipient_strings')) + { + include($phpbb_root_path . 'includes/functions_privmsgs.' . $phpEx); + } $sql_ary = array( 'SELECT' => 'r.report_id, r.report_time, p.msg_id, p.message_subject, p.message_time, p.to_address, p.bcc_address, p.message_attachment, u.username, u.username_clean, u.user_colour, u.user_id, u2.username as author_name, u2.username_clean as author_name_clean, u2.user_colour as author_colour, u2.user_id as author_id', diff --git a/phpBB/includes/mcp/mcp_main.php b/phpBB/includes/mcp/mcp_main.php index a4e3a74ba7..67ba4de334 100644 --- a/phpBB/includes/mcp/mcp_main.php +++ b/phpBB/includes/mcp/mcp_main.php @@ -174,7 +174,10 @@ class mcp_main switch ($mode) { case 'front': - include($phpbb_root_path . 'includes/mcp/mcp_front.' . $phpEx); + if (!function_exists('mcp_front_view')) + { + mcp_front_view($id, $mode, $action); + } $user->add_lang('acp/common'); @@ -185,7 +188,10 @@ class mcp_main break; case 'forum_view': - include($phpbb_root_path . 'includes/mcp/mcp_forum.' . $phpEx); + if (!function_exists('mcp_forum_view')) + { + include($phpbb_root_path . 'includes/mcp/mcp_forum.' . $phpEx); + } $user->add_lang('viewforum'); @@ -208,7 +214,10 @@ class mcp_main break; case 'topic_view': - include($phpbb_root_path . 'includes/mcp/mcp_topic.' . $phpEx); + if (!function_exists('mcp_topic_view')) + { + include($phpbb_root_path . 'includes/mcp/mcp_topic.' . $phpEx); + } mcp_topic_view($id, $mode, $action); @@ -217,7 +226,10 @@ class mcp_main break; case 'post_details': - include($phpbb_root_path . 'includes/mcp/mcp_post.' . $phpEx); + if (!function_exists('mcp_post_details')) + { + include($phpbb_root_path . 'includes/mcp/mcp_post.' . $phpEx); + } mcp_post_details($id, $mode, $action); diff --git a/phpBB/includes/mcp/mcp_topic.php b/phpBB/includes/mcp/mcp_topic.php index 9c63245982..68a65aafdd 100644 --- a/phpBB/includes/mcp/mcp_topic.php +++ b/phpBB/includes/mcp/mcp_topic.php @@ -93,7 +93,11 @@ function mcp_topic_view($id, $mode, $action) // Restore or pprove posts? if (($action == 'restore' || $action == 'approve') && $auth->acl_get('m_approve', $topic_info['forum_id'])) { - include($phpbb_root_path . 'includes/mcp/mcp_queue.' . $phpEx); + if (!class_exists('mcp_queue')) + { + include($phpbb_root_path . 'includes/mcp/mcp_queue.' . $phpEx); + } + include_once($phpbb_root_path . 'includes/functions_posting.' . $phpEx); include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx); diff --git a/phpBB/includes/ucp/ucp_groups.php b/phpBB/includes/ucp/ucp_groups.php index 4673912aed..2423af86be 100644 --- a/phpBB/includes/ucp/ucp_groups.php +++ b/phpBB/includes/ucp/ucp_groups.php @@ -399,7 +399,10 @@ class ucp_groups $action = (isset($_POST['addusers'])) ? 'addusers' : $request->variable('action', ''); $group_id = $request->variable('g', 0); - include($phpbb_root_path . 'includes/functions_display.' . $phpEx); + if (!function_exists('phpbb_get_user_rank')) + { + include($phpbb_root_path . 'includes/functions_display.' . $phpEx); + } add_form_key('ucp_groups'); diff --git a/phpBB/includes/ucp/ucp_main.php b/phpBB/includes/ucp/ucp_main.php index 5214de8c7c..36f45f3f46 100644 --- a/phpBB/includes/ucp/ucp_main.php +++ b/phpBB/includes/ucp/ucp_main.php @@ -245,7 +245,10 @@ class ucp_main case 'subscribed': - include($phpbb_root_path . 'includes/functions_display.' . $phpEx); + if (!function_exists('topic_status')) + { + include($phpbb_root_path . 'includes/functions_display.' . $phpEx); + } $user->add_lang('viewforum'); @@ -481,7 +484,10 @@ class ucp_main break; } - include($phpbb_root_path . 'includes/functions_display.' . $phpEx); + if (!function_exists('topic_status')) + { + include($phpbb_root_path . 'includes/functions_display.' . $phpEx); + } $user->add_lang('viewforum'); diff --git a/phpBB/includes/ucp/ucp_pm.php b/phpBB/includes/ucp/ucp_pm.php index fa374c15c8..4d02620e89 100644 --- a/phpBB/includes/ucp/ucp_pm.php +++ b/phpBB/includes/ucp/ucp_pm.php @@ -82,7 +82,10 @@ class ucp_pm $mode = 'view'; } - include($phpbb_root_path . 'includes/functions_privmsgs.' . $phpEx); + if (!function_exists('get_folder')) + { + include($phpbb_root_path . 'includes/functions_privmsgs.' . $phpEx); + } switch ($mode) { @@ -104,7 +107,10 @@ class ucp_pm break; } - include($phpbb_root_path . 'includes/ucp/ucp_pm_compose.' . $phpEx); + if (!function_exists('compose_pm')) + { + include($phpbb_root_path . 'includes/ucp/ucp_pm_compose.' . $phpEx); + } compose_pm($id, $mode, $action, $user_folders); $tpl_file = 'posting_body'; @@ -114,7 +120,10 @@ class ucp_pm set_user_message_limit(); get_folder($user->data['user_id']); - include($phpbb_root_path . 'includes/ucp/ucp_pm_options.' . $phpEx); + if (!function_exists('message_options')) + { + include($phpbb_root_path . 'includes/ucp/ucp_pm_options.' . $phpEx); + } message_options($id, $mode, $global_privmsgs_rules, $global_rule_conditions); $tpl_file = 'ucp_pm_options'; @@ -125,8 +134,10 @@ class ucp_pm get_folder($user->data['user_id']); $this->p_name = 'pm'; - // Call another module... please do not try this at home... Hoochie Coochie Man - include($phpbb_root_path . 'includes/ucp/ucp_main.' . $phpEx); + if (!class_exists('ucp_main')) + { + include($phpbb_root_path . 'includes/ucp/ucp_main.' . $phpEx); + } $module = new ucp_main($this); $module->u_action = $this->u_action; @@ -375,7 +386,10 @@ class ucp_pm if ($action == 'view_folder') { - include($phpbb_root_path . 'includes/ucp/ucp_pm_viewfolder.' . $phpEx); + if (!function_exists('view_folder')) + { + include($phpbb_root_path . 'includes/ucp/ucp_pm_viewfolder.' . $phpEx); + } view_folder($id, $mode, $folder_id, $folder); $tpl_file = 'ucp_pm_viewfolder'; @@ -393,7 +407,10 @@ class ucp_pm trigger_error('NO_MESSAGE'); } - include($phpbb_root_path . 'includes/ucp/ucp_pm_viewmessage.' . $phpEx); + if (!function_exists('view_message')) + { + include($phpbb_root_path . 'includes/ucp/ucp_pm_viewmessage.' . $phpEx); + } view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row); $tpl_file = ($view == 'print') ? 'ucp_pm_viewmessage_print' : 'ucp_pm_viewmessage'; diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php index 621a945479..543db4f889 100644 --- a/phpBB/includes/ucp/ucp_pm_compose.php +++ b/phpBB/includes/ucp/ucp_pm_compose.php @@ -33,9 +33,20 @@ function compose_pm($id, $mode, $action, $user_folders = array()) // Needed for handle_message_list_actions() global $refresh, $submit, $preview; - include($phpbb_root_path . 'includes/functions_posting.' . $phpEx); - include($phpbb_root_path . 'includes/functions_display.' . $phpEx); - include($phpbb_root_path . 'includes/message_parser.' . $phpEx); + if (!function_exists('generate_smilies')) + { + include($phpbb_root_path . 'includes/functions_posting.' . $phpEx); + } + + if (!function_exists('display_custom_bbcodes')) + { + include($phpbb_root_path . 'includes/functions_display.' . $phpEx); + } + + if (!class_exists('parse_message')) + { + include($phpbb_root_path . 'includes/message_parser.' . $phpEx); + } if (!$action) { diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php index a36bf619f8..9a1284083f 100644 --- a/phpBB/includes/ucp/ucp_profile.php +++ b/phpBB/includes/ucp/ucp_profile.php @@ -469,8 +469,15 @@ class ucp_profile trigger_error('NO_AUTH_SIGNATURE'); } - include($phpbb_root_path . 'includes/functions_posting.' . $phpEx); - include($phpbb_root_path . 'includes/functions_display.' . $phpEx); + if (!function_exists('generate_smilies')) + { + include($phpbb_root_path . 'includes/functions_posting.' . $phpEx); + } + + if (!function_exists('display_custom_bbcodes')) + { + include($phpbb_root_path . 'includes/functions_display.' . $phpEx); + } $preview = $request->is_set_post('preview'); From b4672f2665a4425a8d597bb0c80dee8bfbd89ca0 Mon Sep 17 00:00:00 2001 From: kasimi Date: Wed, 30 Jan 2019 09:48:54 +0100 Subject: [PATCH 54/61] [ticket/15954] Fixed including mcp_front.php PHPBB3-15954 --- phpBB/includes/mcp/mcp_main.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/includes/mcp/mcp_main.php b/phpBB/includes/mcp/mcp_main.php index 67ba4de334..733bcccc09 100644 --- a/phpBB/includes/mcp/mcp_main.php +++ b/phpBB/includes/mcp/mcp_main.php @@ -176,7 +176,7 @@ class mcp_main case 'front': if (!function_exists('mcp_front_view')) { - mcp_front_view($id, $mode, $action); + include($phpbb_root_path . 'includes/mcp/mcp_front.' . $phpEx); } $user->add_lang('acp/common'); From 271db031adbb10317fcb3653201884cb9ec0b0d9 Mon Sep 17 00:00:00 2001 From: 3D-I Date: Fri, 1 Feb 2019 23:24:19 +0100 Subject: [PATCH 55/61] [ticket/15960] Add SQL transactions to functions_admin.php PHPBB3-15960 --- phpBB/includes/functions_admin.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index 2fb83770fe..c19d48b0be 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -3042,6 +3042,8 @@ function tidy_database() } $db->sql_freeresult($result); + $db->sql_transaction('begin'); + // Delete those rows from the acl tables not having listed the forums above $sql = 'DELETE FROM ' . ACL_GROUPS_TABLE . ' WHERE ' . $db->sql_in_set('forum_id', $forum_ids, true); @@ -3051,6 +3053,8 @@ function tidy_database() WHERE ' . $db->sql_in_set('forum_id', $forum_ids, true); $db->sql_query($sql); + $db->sql_transaction('commit'); + $config->set('database_last_gc', time(), false); } From 1fba679c6833ea1e1fa2cd46f5bbc26cee9a3ed8 Mon Sep 17 00:00:00 2001 From: AJ Quick Date: Thu, 31 Jan 2019 18:52:49 -0700 Subject: [PATCH 56/61] [ticket/15959] Fix invalid CNAME record PHPBB3-15959 --- tests/network/checkdnsrr_test.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/network/checkdnsrr_test.php b/tests/network/checkdnsrr_test.php index 6503a4c40b..e67b72118c 100644 --- a/tests/network/checkdnsrr_test.php +++ b/tests/network/checkdnsrr_test.php @@ -38,7 +38,7 @@ class phpbb_network_checkdnsrr_test extends phpbb_test_case array('does-not-exist.phpbb.com', 'AAAA', false), // Existing CNAME record - array('news.cnet.com', 'CNAME', true), + array('www.github.com', 'CNAME', true), // Non-existing CNAME record array('does-not-exist.phpbb.com', 'CNAME', false), From 43d8432809e264c8fdddba85565d527da9d6463d Mon Sep 17 00:00:00 2001 From: AJ Quick Date: Fri, 1 Feb 2019 19:38:42 -0700 Subject: [PATCH 57/61] [ticket/15959] Fix invalid CNAME record PHPBB3-15959 --- tests/network/checkdnsrr_test.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/network/checkdnsrr_test.php b/tests/network/checkdnsrr_test.php index e67b72118c..8cbd4f7e97 100644 --- a/tests/network/checkdnsrr_test.php +++ b/tests/network/checkdnsrr_test.php @@ -38,7 +38,7 @@ class phpbb_network_checkdnsrr_test extends phpbb_test_case array('does-not-exist.phpbb.com', 'AAAA', false), // Existing CNAME record - array('www.github.com', 'CNAME', true), + array('area51.phpbb.com', 'CNAME', true), // Non-existing CNAME record array('does-not-exist.phpbb.com', 'CNAME', false), From 96491a70e8b61ba5700c78dd7b20fe9ca9a3b665 Mon Sep 17 00:00:00 2001 From: rubencm Date: Sat, 9 Feb 2019 12:16:47 +0000 Subject: [PATCH 58/61] [ticket/15965] Fix hardcoded directory PHPBB3-15965 --- phpBB/config/default/container/services_console.yml | 2 ++ phpBB/phpbb/console/command/thumbnail/delete.php | 11 +++++++++-- phpBB/phpbb/console/command/thumbnail/generate.php | 13 ++++++++++--- tests/console/thumbnail_test.php | 5 +++-- 4 files changed, 24 insertions(+), 7 deletions(-) diff --git a/phpBB/config/default/container/services_console.yml b/phpBB/config/default/container/services_console.yml index a327b74ac4..05e467ff8d 100644 --- a/phpBB/config/default/container/services_console.yml +++ b/phpBB/config/default/container/services_console.yml @@ -208,6 +208,7 @@ services: console.command.thumbnail.delete: class: phpbb\console\command\thumbnail\delete arguments: + - '@config' - '@user' - '@dbal.conn' - '%core.root_path%' @@ -217,6 +218,7 @@ services: console.command.thumbnail.generate: class: phpbb\console\command\thumbnail\generate arguments: + - '@config' - '@user' - '@dbal.conn' - '@cache' diff --git a/phpBB/phpbb/console/command/thumbnail/delete.php b/phpBB/phpbb/console/command/thumbnail/delete.php index 9f2ee822be..7b95c20cf2 100644 --- a/phpBB/phpbb/console/command/thumbnail/delete.php +++ b/phpBB/phpbb/console/command/thumbnail/delete.php @@ -18,6 +18,11 @@ use Symfony\Component\Console\Style\SymfonyStyle; class delete extends \phpbb\console\command\command { + /** + * @var \phpbb\config\config + */ + protected $config; + /** * @var \phpbb\db\driver\driver_interface */ @@ -32,12 +37,14 @@ class delete extends \phpbb\console\command\command /** * Constructor * + * @param \config\config $config The config * @param \phpbb\user $user The user object (used to get language information) * @param \phpbb\db\driver\driver_interface $db Database connection * @param string $phpbb_root_path Root path */ - public function __construct(\phpbb\user $user, \phpbb\db\driver\driver_interface $db, $phpbb_root_path) + public function __construct(\phpbb\config\config $config, \phpbb\user $user, \phpbb\db\driver\driver_interface $db, $phpbb_root_path) { + $this->config = $config; $this->db = $db; $this->phpbb_root_path = $phpbb_root_path; @@ -101,7 +108,7 @@ class delete extends \phpbb\console\command\command $return = 0; while ($row = $this->db->sql_fetchrow($result)) { - $thumbnail_path = $this->phpbb_root_path . 'files/thumb_' . $row['physical_filename']; + $thumbnail_path = $this->phpbb_root_path . $this->config['upload_path'] . '/thumb_' . $row['physical_filename']; if (@unlink($thumbnail_path)) { diff --git a/phpBB/phpbb/console/command/thumbnail/generate.php b/phpBB/phpbb/console/command/thumbnail/generate.php index 64f7555336..1f6582b17b 100644 --- a/phpBB/phpbb/console/command/thumbnail/generate.php +++ b/phpBB/phpbb/console/command/thumbnail/generate.php @@ -19,6 +19,11 @@ use Symfony\Component\Console\Style\SymfonyStyle; class generate extends \phpbb\console\command\command { + /** + * @var \phpbb\config\config + */ + protected $config; + /** * @var \phpbb\db\driver\driver_interface */ @@ -45,14 +50,16 @@ class generate extends \phpbb\console\command\command /** * Constructor * + * @param \config\config $config The config * @param \phpbb\user $user The user object (used to get language information) * @param \phpbb\db\driver\driver_interface $db Database connection * @param \phpbb\cache\service $cache The cache service * @param string $phpbb_root_path Root path * @param string $php_ext PHP extension */ - public function __construct(\phpbb\user $user, \phpbb\db\driver\driver_interface $db, \phpbb\cache\service $cache, $phpbb_root_path, $php_ext) + public function __construct(\phpbb\config\config $config, \phpbb\user $user, \phpbb\db\driver\driver_interface $db, \phpbb\cache\service $cache, $phpbb_root_path, $php_ext) { + $this->config = $config; $this->db = $db; $this->cache = $cache; $this->phpbb_root_path = $phpbb_root_path; @@ -126,8 +133,8 @@ class generate extends \phpbb\console\command\command { if (isset($extensions[$row['extension']]['display_cat']) && $extensions[$row['extension']]['display_cat'] == ATTACHMENT_CATEGORY_IMAGE) { - $source = $this->phpbb_root_path . 'files/' . $row['physical_filename']; - $destination = $this->phpbb_root_path . 'files/thumb_' . $row['physical_filename']; + $source = $this->phpbb_root_path . $this->config['upload_path'] . '/' . $row['physical_filename']; + $destination = $this->phpbb_root_path . $this->config['upload_path'] . '/thumb_' . $row['physical_filename']; if (create_thumbnail($source, $destination, $row['mimetype'])) { diff --git a/tests/console/thumbnail_test.php b/tests/console/thumbnail_test.php index d5fbfa0fed..e425d998a2 100644 --- a/tests/console/thumbnail_test.php +++ b/tests/console/thumbnail_test.php @@ -46,6 +46,7 @@ class phpbb_console_command_thumbnail_test extends phpbb_database_test_case $config = $this->config = new \phpbb\config\config(array( 'img_min_thumb_filesize' => 2, 'img_max_thumb_width' => 2, + 'upload_path' => 'files', )); $this->db = $this->db = $this->new_dbal(); @@ -63,8 +64,8 @@ class phpbb_console_command_thumbnail_test extends phpbb_database_test_case ))); $this->application = new Application(); - $this->application->add(new generate($this->user, $this->db, $this->cache, $this->phpbb_root_path, $this->phpEx)); - $this->application->add(new delete($this->user, $this->db, $this->phpbb_root_path)); + $this->application->add(new generate($config, $this->user, $this->db, $this->cache, $this->phpbb_root_path, $this->phpEx)); + $this->application->add(new delete($config, $this->user, $this->db, $this->phpbb_root_path)); $this->application->add(new recreate($this->user)); $phpbb_filesystem = new \phpbb\filesystem\filesystem(); From e315ea90b8f0d5763cd657090cadc99f221e8b44 Mon Sep 17 00:00:00 2001 From: 3D-I Date: Sat, 23 Feb 2019 01:56:03 +0100 Subject: [PATCH 59/61] [ticket/15975] Remove user notification data upon user deletion PHPBB3-15975 --- phpBB/includes/functions_user.php | 3 ++- tests/console/user/base.php | 2 ++ tests/functions/user_delete_test.php | 2 ++ tests/functions_user/delete_user_test.php | 2 ++ 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index 26bb987561..7549ce4d58 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -684,7 +684,8 @@ function user_delete($mode, $user_ids, $retain_username = true) 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') + $phpbb_container->getParameter('tables.auth_provider_oauth_account_assoc'), + $phpbb_container->getParameter('tables.user_notifications') ]; // Ignore errors on deleting from non-existent tables, e.g. when migrating diff --git a/tests/console/user/base.php b/tests/console/user/base.php index 2fb7ee0394..ad328ac893 100644 --- a/tests/console/user/base.php +++ b/tests/console/user/base.php @@ -98,6 +98,8 @@ abstract class phpbb_console_user_base extends phpbb_database_test_case $phpbb_container->setParameter('tables.auth_provider_oauth_states', 'phpbb_oauth_states'); $phpbb_container->setParameter('tables.auth_provider_oauth_account_assoc', 'phpbb_oauth_accounts'); + $phpbb_container->setParameter('tables.user_notifications', 'phpbb_user_notifications'); + parent::setUp(); } diff --git a/tests/functions/user_delete_test.php b/tests/functions/user_delete_test.php index 88680d5719..f419c90e9e 100644 --- a/tests/functions/user_delete_test.php +++ b/tests/functions/user_delete_test.php @@ -86,6 +86,8 @@ class phpbb_functions_user_delete_test extends phpbb_database_test_case $phpbb_container->setParameter('tables.auth_provider_oauth_token_storage', 'phpbb_oauth_tokens'); $phpbb_container->setParameter('tables.auth_provider_oauth_states', 'phpbb_oauth_states'); $phpbb_container->setParameter('tables.auth_provider_oauth_account_assoc', 'phpbb_oauth_accounts'); + + $phpbb_container->setParameter('tables.user_notifications', 'phpbb_user_notifications'); } public function test_user_delete() diff --git a/tests/functions_user/delete_user_test.php b/tests/functions_user/delete_user_test.php index 30253ccc2f..09ed51890c 100644 --- a/tests/functions_user/delete_user_test.php +++ b/tests/functions_user/delete_user_test.php @@ -49,6 +49,8 @@ class phpbb_functions_user_delete_user_test extends phpbb_database_test_case $phpbb_container->setParameter('tables.auth_provider_oauth_token_storage', 'phpbb_oauth_tokens'); $phpbb_container->setParameter('tables.auth_provider_oauth_states', 'phpbb_oauth_states'); $phpbb_container->setParameter('tables.auth_provider_oauth_account_assoc', 'phpbb_oauth_accounts'); + + $phpbb_container->setParameter('tables.user_notifications', 'phpbb_user_notifications'); } public function first_last_post_data() From 43b597e88a952547cc2d3b292369ae663b1eb257 Mon Sep 17 00:00:00 2001 From: 3D-I Date: Thu, 7 Mar 2019 21:04:20 +0100 Subject: [PATCH 60/61] [ticket/15986] Add missing language key for posting.php PHPBB3-15986 --- phpBB/language/en/posting.php | 1 + 1 file changed, 1 insertion(+) diff --git a/phpBB/language/en/posting.php b/phpBB/language/en/posting.php index 7c415b3457..11ea6483e1 100644 --- a/phpBB/language/en/posting.php +++ b/phpBB/language/en/posting.php @@ -145,6 +145,7 @@ $lang = array_merge($lang, array( 'LOAD_DRAFT_EXPLAIN' => 'Here you are able to select the draft you want to continue writing. Your current post will be cancelled, all current post contents will be deleted. View, edit and delete drafts within your User Control Panel.', 'LOGIN_EXPLAIN_BUMP' => 'You need to login in order to bump topics within this forum.', 'LOGIN_EXPLAIN_DELETE' => 'You need to login in order to delete posts within this forum.', + 'LOGIN_EXPLAIN_SOFT_DELETE' => 'You need to login in order to soft-delete posts within this forum.', 'LOGIN_EXPLAIN_POST' => 'You need to login in order to post within this forum.', 'LOGIN_EXPLAIN_QUOTE' => 'You need to login in order to quote posts within this forum.', 'LOGIN_EXPLAIN_REPLY' => 'You need to login in order to reply to topics within this forum.', From 1849ce233b617c3adb1eb5e4791a989f139746ec Mon Sep 17 00:00:00 2001 From: Jakub Senko Date: Fri, 15 Mar 2019 10:43:59 +0100 Subject: [PATCH 61/61] [ticket/15992] Fix breadcrumb structured data Based on: https://developers.google.com/search/docs/data-types/breadcrumb PHPBB3-15992 --- phpBB/styles/prosilver/template/navbar_header.html | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/phpBB/styles/prosilver/template/navbar_header.html b/phpBB/styles/prosilver/template/navbar_header.html index 2da14304c7..dc29285922 100644 --- a/phpBB/styles/prosilver/template/navbar_header.html +++ b/phpBB/styles/prosilver/template/navbar_header.html @@ -179,17 +179,18 @@