From 210c5f5a59a9885b2680432e1d9f4fd915548b27 Mon Sep 17 00:00:00 2001 From: MikelAlejoBR Date: Mon, 23 Jul 2018 17:45:48 +0200 Subject: [PATCH 1/6] [ticket/15697] Remove hard coded time check when sending PMs PHPBB3-15697 --- phpBB/includes/ucp/ucp_pm_compose.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php index bf18e76568..a8d5b8b402 100644 --- a/phpBB/includes/ucp/ucp_pm_compose.php +++ b/phpBB/includes/ucp/ucp_pm_compose.php @@ -80,7 +80,7 @@ function compose_pm($id, $mode, $action, $user_folders = array()) $group_helper = $phpbb_container->get('group_helper'); // Was cancel pressed? If so then redirect to the appropriate page - if ($cancel || ($current_time - $lastclick < 2 && $submit)) + if ($cancel) { if ($msg_id) { From 740006ba60a2f5dce6e0aee072f5683f3f47b69a Mon Sep 17 00:00:00 2001 From: MikelAlejoBR Date: Sat, 28 Jul 2018 13:15:31 +0200 Subject: [PATCH 2/6] [ticket/15697] Remove unused variable and corresponding input field PHPBB3-15697 --- phpBB/includes/ucp/ucp_pm_compose.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php index a8d5b8b402..2b8468590e 100644 --- a/phpBB/includes/ucp/ucp_pm_compose.php +++ b/phpBB/includes/ucp/ucp_pm_compose.php @@ -48,7 +48,6 @@ function compose_pm($id, $mode, $action, $user_folders = array()) $to_group_id = $request->variable('g', 0); $msg_id = $request->variable('p', 0); $draft_id = $request->variable('d', 0); - $lastclick = $request->variable('lastclick', 0); // Reply to all triggered (quote/reply) $reply_to_all = $request->variable('reply_to_all', 0); @@ -1174,7 +1173,6 @@ function compose_pm($id, $mode, $action, $user_folders = array()) break; } - $s_hidden_fields = ''; $s_hidden_fields .= (isset($check_value)) ? '' : ''; $s_hidden_fields .= ($draft_id || isset($_REQUEST['draft_loaded'])) ? '' : ''; From b2277e7bf688168acfa3097730f556b7218858ac Mon Sep 17 00:00:00 2001 From: MikelAlejoBR Date: Sat, 28 Jul 2018 14:29:37 +0200 Subject: [PATCH 3/6] [ticket/15733] Remove unused code related to deprecated flood control PHPBB3-15733 --- phpBB/posting.php | 6 ------ phpBB/viewtopic.php | 1 - tests/test_framework/phpbb_functional_test_case.php | 4 ---- 3 files changed, 11 deletions(-) diff --git a/phpBB/posting.php b/phpBB/posting.php index 3530bb5048..bf0dfb9c6c 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -33,7 +33,6 @@ $post_id = $request->variable('p', 0); $topic_id = $request->variable('t', 0); $forum_id = $request->variable('f', 0); $draft_id = $request->variable('d', 0); -$lastclick = $request->variable('lastclick', 0); $preview = (isset($_POST['preview'])) ? true : false; $save = (isset($_POST['save'])) ? true : false; @@ -68,7 +67,6 @@ $current_time = time(); * @var int topic_id ID of the topic * @var int forum_id ID of the forum * @var int draft_id ID of the draft -* @var int lastclick Timestamp of when the form was last loaded * @var bool submit Whether or not the form has been submitted * @var bool preview Whether or not the post is being previewed * @var bool save Whether or not a draft is being saved @@ -91,7 +89,6 @@ $vars = array( 'topic_id', 'forum_id', 'draft_id', - 'lastclick', 'submit', 'preview', 'save', @@ -354,7 +351,6 @@ switch ($mode) * @var int topic_id ID of the topic * @var int forum_id ID of the forum * @var int draft_id ID of the draft -* @var int lastclick Timestamp of when the form was last loaded * @var bool submit Whether or not the form has been submitted * @var bool preview Whether or not the post is being previewed * @var bool save Whether or not a draft is being saved @@ -376,7 +372,6 @@ $vars = array( 'topic_id', 'forum_id', 'draft_id', - 'lastclick', 'submit', 'preview', 'save', @@ -1762,7 +1757,6 @@ if ($config['enable_post_confirm'] && !$user->data['is_registered'] && (isset($c } $s_hidden_fields = ($mode == 'reply' || $mode == 'quote') ? '' : ''; -$s_hidden_fields .= ''; $s_hidden_fields .= ($draft_id || isset($_REQUEST['draft_loaded'])) ? '' : ''; if ($mode == 'edit') diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 3c25c3b037..79852330d9 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -2249,7 +2249,6 @@ if ($s_can_vote || $s_quick_reply) $qr_hidden_fields = array( 'topic_cur_post_id' => (int) $topic_data['topic_last_post_id'], - 'lastclick' => (int) time(), 'topic_id' => (int) $topic_data['topic_id'], 'forum_id' => (int) $forum_id, ); diff --git a/tests/test_framework/phpbb_functional_test_case.php b/tests/test_framework/phpbb_functional_test_case.php index e1daa4558a..12a296a4bf 100644 --- a/tests/test_framework/phpbb_functional_test_case.php +++ b/tests/test_framework/phpbb_functional_test_case.php @@ -1176,10 +1176,6 @@ class phpbb_functional_test_case extends phpbb_test_case } } - // Bypass time restriction that said that if the lastclick time (i.e. time when the form was opened) - // is not at least 2 seconds before submission, cancel the form - $form_data['lastclick'] = 0; - // I use a request because the form submission method does not allow you to send data that is not // contained in one of the actual form fields that the browser sees (i.e. it ignores "hidden" inputs) // Instead, I send it as a request with the submit button "post" set to true. From a7d7dfee9ce8ca070b8fda0df3069aa05fe12ceb Mon Sep 17 00:00:00 2001 From: MikelAlejoBR Date: Sat, 28 Jul 2018 22:22:38 +0200 Subject: [PATCH 4/6] [ticket/15733] Add "changed" tag to the corresponding comment blocks PHPBB3-15733 --- phpBB/posting.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/phpBB/posting.php b/phpBB/posting.php index bf0dfb9c6c..d867c6d67e 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -83,6 +83,7 @@ $current_time = time(); * language keys. * @since 3.1.0-a1 * @changed 3.1.2-RC1 Removed 'delete' var as it does not exist +* @changed 3.2.4 Remove unused 'lastclick' var */ $vars = array( 'post_id', @@ -366,6 +367,7 @@ switch ($mode) * @var array post_data All post data from database * @since 3.1.3-RC1 * @changed 3.1.10-RC1 Added post_data +* @changed 3.2.4 Remove unused 'lastclick' var */ $vars = array( 'post_id', From e710304ef5cd4fb06d83ccb3213c8df7f8b04b36 Mon Sep 17 00:00:00 2001 From: MikelAlejoBR Date: Sun, 29 Jul 2018 11:59:46 +0200 Subject: [PATCH 5/6] [ticket/15733] Correct "changed" tag version to 3.2.4-RC1 PHPBB3-15733 --- phpBB/posting.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpBB/posting.php b/phpBB/posting.php index d867c6d67e..d97a22209f 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -83,7 +83,7 @@ $current_time = time(); * language keys. * @since 3.1.0-a1 * @changed 3.1.2-RC1 Removed 'delete' var as it does not exist -* @changed 3.2.4 Remove unused 'lastclick' var +* @changed 3.2.4-RC1 Remove unused 'lastclick' var */ $vars = array( 'post_id', @@ -367,7 +367,7 @@ switch ($mode) * @var array post_data All post data from database * @since 3.1.3-RC1 * @changed 3.1.10-RC1 Added post_data -* @changed 3.2.4 Remove unused 'lastclick' var +* @changed 3.2.4-RC1 Remove unused 'lastclick' var */ $vars = array( 'post_id', From 5be990e9599f41a87d2c9d847a351b4b03e8debd Mon Sep 17 00:00:00 2001 From: MikelAlejoBR Date: Sun, 29 Jul 2018 13:32:19 +0200 Subject: [PATCH 6/6] [ticket/15733] Fix undeclared variable concatenation PHPBB3-15733 --- phpBB/includes/ucp/ucp_pm_compose.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php index 2b8468590e..f35812b90a 100644 --- a/phpBB/includes/ucp/ucp_pm_compose.php +++ b/phpBB/includes/ucp/ucp_pm_compose.php @@ -1173,7 +1173,7 @@ function compose_pm($id, $mode, $action, $user_folders = array()) break; } - $s_hidden_fields .= (isset($check_value)) ? '' : ''; + $s_hidden_fields = (isset($check_value)) ? '' : ''; $s_hidden_fields .= ($draft_id || isset($_REQUEST['draft_loaded'])) ? '' : ''; $form_enctype = (@ini_get('file_uploads') == '0' || strtolower(@ini_get('file_uploads')) == 'off' || !$config['allow_pm_attach'] || !$auth->acl_get('u_pm_attach')) ? '' : ' enctype="multipart/form-data"';