mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 05:50:42 +02:00
Merge pull request #3965 from marc1706/ticket/14234
[ticket/14234] Use replacement variables instead of references in events * marc1706/ticket/14234: [ticket/14234] Fix event doc blocks [ticket/14234] Get rid of undefined variables [ticket/14234] Fix change version and remove more references [ticket/14234] Replace more references with variables [ticket/14234] Use replacement variables instead of references in events
This commit is contained in:
@@ -1364,6 +1364,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
|
||||
*
|
||||
@@ -1372,23 +1374,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')
|
||||
@@ -1713,22 +1720,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',
|
||||
@@ -1736,6 +1746,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_ary);
|
||||
unset($data_ary);
|
||||
|
||||
// Submit new topic
|
||||
if ($post_mode == 'post')
|
||||
@@ -2283,6 +2297,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
|
||||
@@ -2296,8 +2312,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
|
||||
@@ -2306,20 +2322,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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user