diff options
-rw-r--r-- | phpBB/includes/acp/acp_forums.php | 6 | ||||
-rw-r--r-- | phpBB/includes/functions_acp.php | 4 | ||||
-rw-r--r-- | phpBB/includes/functions_content.php | 2 | ||||
-rw-r--r-- | phpBB/includes/functions_display.php | 2 | ||||
-rw-r--r-- | phpBB/includes/functions_mcp.php | 36 | ||||
-rw-r--r-- | phpBB/includes/functions_posting.php | 45 | ||||
-rw-r--r-- | phpBB/includes/functions_privmsgs.php | 16 | ||||
-rw-r--r-- | phpBB/includes/mcp/mcp_forum.php | 6 |
8 files changed, 83 insertions, 34 deletions
diff --git a/phpBB/includes/acp/acp_forums.php b/phpBB/includes/acp/acp_forums.php index d81eef7871..8faca73019 100644 --- a/phpBB/includes/acp/acp_forums.php +++ b/phpBB/includes/acp/acp_forums.php @@ -959,7 +959,7 @@ class acp_forums * @var array errors Array of errors, should be strings and not * language key. * @since 3.1.0-a1 - * @change 3.1.7-RC1 Replaced forum_data with forum_data_ary + * @change 3.2.0-a1 Replaced forum_data with forum_data_ary */ $vars = array('forum_data_ary', 'errors'); extract($phpbb_dispatcher->trigger_event('core.acp_manage_forums_validate_data', compact($vars))); @@ -1072,7 +1072,7 @@ class acp_forums * If forum_data_sql[forum_id] is set, we update * that forum, otherwise a new one is created. * @since 3.1.0-a1 - * @change 3.1.7-RC1 Replaced forum_data by forum_data_ary + * @change 3.2.0-a1 Replaced forum_data by forum_data_ary */ $vars = array('forum_data_ary', 'forum_data_sql'); extract($phpbb_dispatcher->trigger_event('core.acp_manage_forums_update_data_before', compact($vars))); @@ -1369,7 +1369,7 @@ class acp_forums * @var array errors Array of errors, should be strings and not * language key. * @since 3.1.0-a1 - * @change 3.1.7-RC1 Replaced forum_data with forum_data_ary + * @change 3.2.0-a1 Replaced forum_data with forum_data_ary */ $vars = array('forum_data_ary', 'forum_data_sql', 'is_new_forum', 'errors'); extract($phpbb_dispatcher->trigger_event('core.acp_manage_forums_update_data_after', compact($vars))); diff --git a/phpBB/includes/functions_acp.php b/phpBB/includes/functions_acp.php index b6f9de98f3..9ed20cd450 100644 --- a/phpBB/includes/functions_acp.php +++ b/phpBB/includes/functions_acp.php @@ -398,12 +398,12 @@ function build_cfg_template($tpl_type, $key, &$new, $config_key, $vars) * @var array vars Array with the options for the config * @var string tpl The resulting html code we display * @since 3.1.0-a1 - * @change 3.1.7-RC1 Replaced new with new_ary + * @change 3.2.0-a1 Replaced new with new_ary */ $vars = array('tpl_type', 'key', 'new_ary', 'name', 'vars', 'tpl'); extract($phpbb_dispatcher->trigger_event('core.build_config_template', compact($vars))); $new = $new_ary; - unset($new); + unset($new_ary); return $tpl; } diff --git a/phpBB/includes/functions_content.php b/phpBB/includes/functions_content.php index 1b5fffc445..b87220caa5 100644 --- a/phpBB/includes/functions_content.php +++ b/phpBB/includes/functions_content.php @@ -1226,7 +1226,7 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count, * @var bool preview Flag indicating if we are in post preview mode * @var array update_count_ary Array with attachment ids to update download count * @since 3.1.0-RC5 - * @change 3.1.7-RC1 Replaced update_count with update_count_ary + * @change 3.2.0-a1 Replaced update_count with update_count_ary */ $vars = array( 'attachment', diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index 0143a2b9ab..9e45f32689 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -1249,7 +1249,7 @@ function display_user_activity(&$userdata) * @var array active_f_row List of active forums * @var array active_t_row List of active posts * @since 3.1.0-RC3 - * @change 3.1.7-RC1 Replaced userdata with userdata_ary + * @change 3.2.0-a1 Replaced userdata with userdata_ary */ $vars = array('userdata_ary', 'active_f_row', 'active_t_row'); extract($phpbb_dispatcher->trigger_event('core.display_user_activity_modify_actives', compact($vars))); diff --git a/phpBB/includes/functions_mcp.php b/phpBB/includes/functions_mcp.php index 50acbebd4f..f9e38e8aa0 100644 --- a/phpBB/includes/functions_mcp.php +++ b/phpBB/includes/functions_mcp.php @@ -557,6 +557,11 @@ function phpbb_mcp_sorting($mode, &$sort_days, &$sort_key, &$sort_dir, &$sort_by // Default total to -1 to allow editing by the event $total = -1; + $sort_by_sql_ary = $sort_by_sql; + $sort_days_val = $sort_days; + $sort_dir_val = $sort_dir; + $sort_key_val = $sort_key; + $total_val = $total; /** * This event allows you to control the SQL query used to get the total number * of reports the user can access. @@ -571,19 +576,20 @@ function phpbb_mcp_sorting($mode, &$sort_days, &$sort_key, &$sort_dir, &$sort_by * @var string type Which kind of information is this being used for displaying. Posts, topics, etc... * @var int forum_id The forum id of the posts the user is trying to access, if not 0 * @var int topic_id The topic id of the posts the user is trying to access, if not 0 - * @var int sort_days The max age of the oldest report to be shown, in days - * @var string sort_key The way the user has decided to sort the data. + * @var int sort_days_val The max age of the oldest report to be shown, in days + * @var string sort_key_val The way the user has decided to sort the data. * The valid values must be in the keys of the sort_by_* variables - * @var string sort_dir Either 'd' for "DESC" or 'a' for 'ASC' in the SQL query + * @var string sort_dir_val Either 'd' for "DESC" or 'a' for 'ASC' in the SQL query * @var int limit_days The possible max ages of the oldest report for the user to choose, in days. - * @var array sort_by_sql SQL text (values) for the possible names of the ways of sorting data (keys). + * @var array sort_by_sql_ary SQL text (values) for the possible names of the ways of sorting data (keys). * @var array sort_by_text Language text (values) for the possible names of the ways of sorting data (keys). * @var int min_time Integer with the minimum post time that the user is searching for * @var int limit_time_sql Time limiting options used in the SQL query. - * @var int total The total number of reports that exist. Only set if you want to override the result + * @var int total_val The total number of reports that exist. Only set if you want to override the result * @var string where_sql Extra information included in the WHERE clause. It must end with "WHERE" or "AND" or "OR". * Set to "WHERE" and set total above -1 to override the total value * @since 3.1.4-RC1 + * @change 3.2.0-a1 Replaced sort_days, sort_key, sort_dir, sort_by_sql, total with replacement variables */ $vars = array( 'sql', @@ -591,18 +597,28 @@ function phpbb_mcp_sorting($mode, &$sort_days, &$sort_key, &$sort_dir, &$sort_by 'type', 'forum_id', 'topic_id', - 'sort_days', - 'sort_key', - 'sort_dir', + 'sort_days_val', + 'sort_key_val', + 'sort_dir_val', 'limit_days', - 'sort_by_sql', + 'sort_by_sql_ary', 'sort_by_text', 'min_time', 'limit_time_sql', - 'total', + 'total_val', 'where_sql', ); extract($phpbb_dispatcher->trigger_event('core.mcp_sorting_query_before', compact($vars))); + $sort_by_sql = $sort_by_sql_ary; + $sort_days = $sort_days_val; + $sort_key = $sort_key_val; + $sort_dir = $sort_dir_val; + $total = $total_val; + unset($sort_by_sql_ary); + unset($sort_days_val); + unset($sort_key_val); + unset($sort_dir_val); + unset($total_val); if (!isset($sort_by_sql[$sort_key])) { diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 19756d97b4..97daab8887 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -1520,6 +1520,8 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u { global $db, $auth, $user, $config, $phpEx, $template, $phpbb_root_path, $phpbb_container, $phpbb_dispatcher, $phpbb_log, $request; + $poll_ary = $poll; + $data_ary = $data; /** * Modify the data for post submitting * @@ -1528,23 +1530,28 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u * @var string subject Variable containing post subject value * @var string username Variable containing post author name * @var int topic_type Variable containing topic type value - * @var array poll Array with the poll data for the post - * @var array data Array with the data for the post + * @var array poll_ary Array with the poll data for the post + * @var array data_ary Array with the data for the post * @var bool update_message Flag indicating if the post will be updated * @var bool update_search_index Flag indicating if the search index will be updated * @since 3.1.0-a4 + * @change 3.2.0-a1 Replaced poll and data with poll_ary and data_ary */ $vars = array( 'mode', 'subject', 'username', 'topic_type', - 'poll', - 'data', + 'poll_ary', + 'data_ary', 'update_message', 'update_search_index', ); extract($phpbb_dispatcher->trigger_event('core.modify_submit_post_data', compact($vars))); + $poll = $poll_ary; + $data = $data_ary; + unset($poll_ary); + unset($data_ary); // We do not handle erasing posts here if ($mode == 'delete') @@ -1869,22 +1876,25 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u break; } + $poll_ary = $poll; + $data_ary = $data; /** * Modify sql query data for post submitting * * @event core.submit_post_modify_sql_data - * @var array data Array with the data for the post - * @var array poll Array with the poll data for the post + * @var array data_ary Array with the data for the post + * @var array poll_ary Array with the poll data for the post * @var string post_mode Variable containing posting mode value * @var bool sql_data Array with the data for the posting SQL query * @var string subject Variable containing post subject value * @var int topic_type Variable containing topic type value * @var string username Variable containing post author name * @since 3.1.3-RC1 + * @change 3.2.0-a1 Replace poll and data with poll_ary and data_ary */ $vars = array( - 'data', - 'poll', + 'data_ary', + 'poll_ary', 'post_mode', 'sql_data', 'subject', @@ -1892,6 +1902,10 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u 'username', ); extract($phpbb_dispatcher->trigger_event('core.submit_post_modify_sql_data', compact($vars))); + $poll = $poll_ary; + $data = $data_ary; + unset($poll); + unset($data); // Submit new topic if ($post_mode == 'post') @@ -2439,6 +2453,8 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u $url = (!$params) ? "{$phpbb_root_path}viewforum.$phpEx" : "{$phpbb_root_path}viewtopic.$phpEx"; $url = append_sid($url, 'f=' . $data['forum_id'] . $params) . $add_anchor; + $poll_ary = $poll; + $data_ary = $data; /** * This event is used for performing actions directly after a post or topic * has been submitted. When a new topic is posted, the topic ID is @@ -2452,8 +2468,8 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u * @var string subject Variable containing post subject value * @var string username Variable containing post author name * @var int topic_type Variable containing topic type value - * @var array poll Array with the poll data for the post - * @var array data Array with the data for the post + * @var array poll_ary Array with the poll data for the post + * @var array data_ary Array with the data for the post * @var int post_visibility Variable containing up to date post visibility * @var bool update_message Flag indicating if the post will be updated * @var bool update_search_index Flag indicating if the search index will be updated @@ -2462,20 +2478,25 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u * @since 3.1.0-a3 * @change 3.1.0-RC3 Added vars mode, subject, username, topic_type, * poll, update_message, update_search_index + * @change 3.2.0-a1 Replaced data and poll with data_ary and poll_ary */ $vars = array( 'mode', 'subject', 'username', 'topic_type', - 'poll', - 'data', + 'poll_ary', + 'data_ary', 'post_visibility', 'update_message', 'update_search_index', 'url', ); extract($phpbb_dispatcher->trigger_event('core.submit_post_end', compact($vars))); + $data = $data_ary; + $poll = $poll_ary; + unset($data_ary); + unset($poll_ary); return $url; } diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php index 7b6540cda7..ae925b15c8 100644 --- a/phpBB/includes/functions_privmsgs.php +++ b/phpBB/includes/functions_privmsgs.php @@ -1624,17 +1624,21 @@ function submit_pm($mode, $subject, &$data, $put_in_outbox = true) $current_time = time(); + $data_ary = $data; /** * Get all parts of the PM that are to be submited to the DB. * * @event core.submit_pm_before * @var string mode PM Post mode - post|reply|quote|quotepost|forward|edit * @var string subject Subject of the private message - * @var array data The whole row data of the PM. + * @var array data_ary The whole row data of the PM. * @since 3.1.0-b3 + * @change 3.2.0-a1 Replaced data with data_ary */ - $vars = array('mode', 'subject', 'data'); + $vars = array('mode', 'subject', 'data_ary'); extract($phpbb_dispatcher->trigger_event('core.submit_pm_before', compact($vars))); + $data = $data_ary; + unset($data_ary); // Collect some basic information about which tables and which rows to update/insert $sql_data = array(); @@ -1943,18 +1947,22 @@ function submit_pm($mode, $subject, &$data, $put_in_outbox = true) $phpbb_notifications->add_notifications('notification.type.pm', $pm_data); } + $data_ary = $data; /** * Get PM message ID after submission to DB * * @event core.submit_pm_after * @var string mode PM Post mode - post|reply|quote|quotepost|forward|edit * @var string subject Subject of the private message - * @var array data The whole row data of the PM. + * @var array data_ary The whole row data of the PM. * @var array pm_data The data sent to notification class * @since 3.1.0-b5 + * @change 3.2.0-a1 Replaced data with data_ary */ - $vars = array('mode', 'subject', 'data', 'pm_data'); + $vars = array('mode', 'subject', 'data_ary', 'pm_data'); extract($phpbb_dispatcher->trigger_event('core.submit_pm_after', compact($vars))); + $data = $data_ary; + unset($data_ary); return $data['msg_id']; } diff --git a/phpBB/includes/mcp/mcp_forum.php b/phpBB/includes/mcp/mcp_forum.php index f73973b81d..c2e17e9f39 100644 --- a/phpBB/includes/mcp/mcp_forum.php +++ b/phpBB/includes/mcp/mcp_forum.php @@ -334,16 +334,20 @@ function mcp_forum_view($id, $mode, $action, $forum_info) )); } + $row_ary = $row; /** * Modify the topic data before it is assigned to the template in MCP * * @event core.mcp_view_forum_modify_topicrow - * @var array row Array with topic data + * @var array row_ary Array with topic data * @var array topic_row Template array with topic data * @since 3.1.0-a1 + * @change 3.2.0-a1 Replace row with row_ary */ $vars = array('row', 'topic_row'); extract($phpbb_dispatcher->trigger_event('core.mcp_view_forum_modify_topicrow', compact($vars))); + $row = $row_ary; + unset($row_ary); $template->assign_block_vars('topicrow', $topic_row); } |