aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions_posting.php
diff options
context:
space:
mode:
authorTristan Darricau <tristan.darricau@sensiolabs.com>2015-10-14 08:59:17 +0200
committerTristan Darricau <tristan.darricau@sensiolabs.com>2015-10-14 08:59:17 +0200
commit1d6e1732597fca176353e674c72b2543c77273f3 (patch)
tree51fb4cca11a8df7c87145a833b986f5d9832b838 /phpBB/includes/functions_posting.php
parentcac090b659a90749a8ea6ed7f62af980ffe7c60d (diff)
parent102d737d811739aa6ff9687e1585c2012b394d02 (diff)
downloadforums-1d6e1732597fca176353e674c72b2543c77273f3.tar
forums-1d6e1732597fca176353e674c72b2543c77273f3.tar.gz
forums-1d6e1732597fca176353e674c72b2543c77273f3.tar.bz2
forums-1d6e1732597fca176353e674c72b2543c77273f3.tar.xz
forums-1d6e1732597fca176353e674c72b2543c77273f3.zip
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
Diffstat (limited to 'phpBB/includes/functions_posting.php')
-rw-r--r--phpBB/includes/functions_posting.php45
1 files changed, 33 insertions, 12 deletions
diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php
index ca43de7f67..4f14dc8683 100644
--- a/phpBB/includes/functions_posting.php
+++ b/phpBB/includes/functions_posting.php
@@ -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;
}