From 75e5e2471e7b6b9e1d605f0c3cce5f1fbd373ac0 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Mon, 12 Oct 2015 21:56:09 +0200 Subject: [PATCH] [ticket/14234] Get rid of undefined variables PHPBB3-14234 --- phpBB/includes/functions_posting.php | 4 ++-- phpBB/includes/ucp/ucp_pm_compose.php | 13 ++----------- phpBB/posting.php | 9 +++------ phpBB/search.php | 2 +- 4 files changed, 8 insertions(+), 20 deletions(-) diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 97daab8887..d94edc4257 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -1904,8 +1904,8 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u extract($phpbb_dispatcher->trigger_event('core.submit_post_modify_sql_data', compact($vars))); $poll = $poll_ary; $data = $data_ary; - unset($poll); - unset($data); + unset($poll_ary); + unset($data_ary); // Submit new topic if ($post_mode == 'post') diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php index 5c32a23ad6..c960591b46 100644 --- a/phpBB/includes/ucp/ucp_pm_compose.php +++ b/phpBB/includes/ucp/ucp_pm_compose.php @@ -266,8 +266,6 @@ function compose_pm($id, $mode, $action, $user_folders = array()) * * @event core.ucp_pm_compose_compose_pm_basic_info_query_before * @var string sql String with the query to be executed - * @var array forum_list List of forums that contain the posts - * @var int visibility_const Integer with one of the possible ITEM_* constant values * @var int msg_id topic_id in the page request * @var int to_user_id The id of whom the message is to * @var int to_group_id The id of the group whom the message is to @@ -276,14 +274,11 @@ function compose_pm($id, $mode, $action, $user_folders = array()) * @var string action One of: post, reply, quote, forward, quotepost, edit, delete, smilies * @var bool delete Whether the user is deleting the PM * @var int reply_to_all Value of reply_to_all request variable. - * @var string limit_time_sql String with the SQL code to limit the time interval of the post (Note: May be empty string) - * @var string sort_order_sql String with the ORDER BY SQL code used in this query * @since 3.1.0-RC5 + * @change 3.2.0-a1 Removed undefined variables */ $vars = array( 'sql', - 'forum_list', - 'visibility_const', 'msg_id', 'to_user_id', 'to_group_id', @@ -292,8 +287,6 @@ function compose_pm($id, $mode, $action, $user_folders = array()) 'action', 'delete', 'reply_to_all', - 'limit_time_sql', - 'sort_order_sql', ); extract($phpbb_dispatcher->trigger_event('core.ucp_pm_compose_compose_pm_basic_info_query_before', compact($vars))); @@ -338,7 +331,6 @@ function compose_pm($id, $mode, $action, $user_folders = array()) * @var string sql The original SQL used in the query * @var array post Associative array with the data of the quoted post * @var array msg_id The post_id that was searched to get the message for quoting - * @var int visibility_const Visibility of the quoted post (one of the possible ITEM_* constant values) * @var int topic_id Topic ID of the quoted post * @var int to_user_id Users the message is sent to * @var int to_group_id Groups the message is sent to @@ -348,13 +340,12 @@ function compose_pm($id, $mode, $action, $user_folders = array()) * @var bool delete If deleting message * @var int reply_to_all Value of reply_to_all request variable. * @since 3.1.0-RC5 + * @change 3.2.0-a1 Removed undefined variables */ $vars = array( 'sql', 'post', 'msg_id', - 'visibility_const', - 'topic_id', 'to_user_id', 'to_group_id', 'submit', diff --git a/phpBB/posting.php b/phpBB/posting.php index 47fdb2d378..a8e4e4015e 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -1256,7 +1256,6 @@ if ($submit || $preview || $refresh) * @var array poll Array with poll data from post (must be used instead of the post_data equivalent) * @var string mode What action to take if the form is submitted * post|reply|quote|edit|delete|bump|smilies|popup - * @var string page_title Title of the mode page * @var int post_id ID of the post * @var int topic_id ID of the topic * @var int forum_id ID of the forum @@ -1265,12 +1264,12 @@ if ($submit || $preview || $refresh) * NOTE: Should be actual language strings, NOT language keys. * @since 3.1.0-RC5 * @change 3.1.5-RC1 Added poll array to the event + * @change 3.2.0-a1 Removed undefined page_title */ $vars = array( 'post_data', 'poll', 'mode', - 'page_title', 'post_id', 'topic_id', 'forum_id', @@ -1383,7 +1382,6 @@ if ($submit || $preview || $refresh) * @var array data Array with post data going to be stored in the database * @var string mode What action to take if the form is submitted * post|reply|quote|edit|delete - * @var string page_title Title of the mode page * @var int post_id ID of the post * @var int topic_id ID of the topic * @var int forum_id ID of the forum @@ -1393,13 +1391,13 @@ if ($submit || $preview || $refresh) * NOTE: Should be actual language strings, NOT language keys. * @since 3.1.0-RC5 * @changed 3.1.6-RC1 remove submit and error from event Submit and Error are checked previously prior to running event + * @change 3.2.0-a1 Removed undefined page_title */ $vars = array( 'post_data', 'poll', 'data', 'mode', - 'page_title', 'post_id', 'topic_id', 'forum_id', @@ -1421,7 +1419,6 @@ if ($submit || $preview || $refresh) * @var array data Array with post data going to be stored in the database * @var string mode What action to take if the form is submitted * post|reply|quote|edit|delete - * @var string page_title Title of the mode page * @var int post_id ID of the post * @var int topic_id ID of the topic * @var int forum_id ID of the forum @@ -1432,13 +1429,13 @@ if ($submit || $preview || $refresh) * NOTE: Should be actual language strings, NOT language keys. * @since 3.1.0-RC5 * @changed 3.1.6-RC1 remove submit and error from event Submit and Error are checked previously prior to running event + * @change 3.2.0-a1 Removed undefined page_title */ $vars = array( 'post_data', 'poll', 'data', 'mode', - 'page_title', 'post_id', 'topic_id', 'forum_id', diff --git a/phpBB/search.php b/phpBB/search.php index 13e842c7f8..d9e5d0557a 100644 --- a/phpBB/search.php +++ b/phpBB/search.php @@ -779,7 +779,7 @@ if ($keywords || $author || $author_id || $search_id || $submit) $result = $db->sql_query($sql); $result_topic_id = 0; - $rowset = array(); + $rowset = $attachments = $topic_tracking_info = array(); if ($show_results == 'topics') {