[ticket/16138] Use array to pass parameters to append_sid()

PHPBB3-16138
This commit is contained in:
Marc Alexander 2021-05-24 16:14:17 +02:00
parent 6a0b1333da
commit 3f518c9263
No known key found for this signature in database
GPG key ID: 50E0D2423696F995

View file

@ -2541,23 +2541,24 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll_ary, &$data
}
}
$params = $add_anchor = '';
$params = [];
$add_anchor = '';
if ($post_visibility == ITEM_APPROVED ||
($auth->acl_get('m_softdelete', $data_ary['forum_id']) && $post_visibility == ITEM_DELETED) ||
($auth->acl_get('m_approve', $data_ary['forum_id']) && in_array($post_visibility, array(ITEM_UNAPPROVED, ITEM_REAPPROVE))))
{
$params .= '&t=' . $data_ary['topic_id'];
$params['t'] = $data_ary['topic_id'];
if ($mode != 'post')
{
$params .= '&p=' . $data_ary['post_id'];
$params['p'] = $data_ary['post_id'];
$add_anchor = '#p' . $data_ary['post_id'];
}
}
else if ($mode != 'post' && $post_mode != 'edit_first_post' && $post_mode != 'edit_topic')
{
$params .= '&t=' . $data_ary['topic_id'];
$params['t'] = $data_ary['topic_id'];
}
$url = (!$params) ? "{$phpbb_root_path}viewforum.$phpEx" : "{$phpbb_root_path}viewtopic.$phpEx";