1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-04-22 00:32:29 +02:00

[ticket/14170] Fix mcp_change_poster_after event

Move the mcp_change_poster_after event to before renewing $post_info. I
changed the "since" version as this would be fixed in 3.1.7-RC1.

PHPBB3-14170
This commit is contained in:
Kailey Truscott 2015-09-16 22:37:29 -04:00
parent d92a46ef02
commit 07b55530ec

View File

@ -549,6 +549,17 @@ function change_poster(&$post_info, $userdata)
$from_username = $post_info['username'];
$to_username = $userdata['username'];
/**
* This event allows you to perform additional tasks after changing a post's poster
*
* @event core.mcp_change_poster_after
* @var array userdata Information on a post's new poster
* @var array post_info Information on the affected post
* @since 3.1.7-RC1
*/
$vars = array('userdata', 'post_info');
extract($phpbb_dispatcher->trigger_event('core.mcp_change_poster_after', compact($vars)));
// Renew post info
$post_info = phpbb_get_post_data(array($post_id), false, true);
@ -559,17 +570,6 @@ function change_poster(&$post_info, $userdata)
$post_info = $post_info[$post_id];
/**
* This event allows you to perform additional tasks after changing a post's poster
*
* @event core.mcp_change_poster_after
* @var array userdata Information on a post's new poster
* @var array post_info Information on the affected post
* @since 3.1.6-RC1
*/
$vars = array('userdata', 'post_info');
extract($phpbb_dispatcher->trigger_event('core.mcp_change_poster_after', compact($vars)));
// Now add log entry
add_log('mod', $post_info['forum_id'], $post_info['topic_id'], 'LOG_MCP_CHANGE_POSTER', $post_info['topic_title'], $from_username, $to_username);
}