aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/posting.php
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2013-08-23 22:52:33 +0200
committerJoas Schilling <nickvergessen@gmx.de>2013-08-23 23:17:52 +0200
commit2845b153d8e86b80c6b9a8c0869474affb277516 (patch)
tree762fa44287e1bc8e6ec11c101a4a371b6a465ca7 /phpBB/posting.php
parentba9d303d525e3b8a12748da02080e3cbc6644a3b (diff)
downloadforums-2845b153d8e86b80c6b9a8c0869474affb277516.tar
forums-2845b153d8e86b80c6b9a8c0869474affb277516.tar.gz
forums-2845b153d8e86b80c6b9a8c0869474affb277516.tar.bz2
forums-2845b153d8e86b80c6b9a8c0869474affb277516.tar.xz
forums-2845b153d8e86b80c6b9a8c0869474affb277516.zip
[ticket/11769] Correctly supply the post author's username in posting.php
Only supply the username, when it is a guest posting or we edit and it was supplied, otherwise post_data might hold data of the post we quote, in which case username is the original poster, not the current one. PHPBB3-11769
Diffstat (limited to 'phpBB/posting.php')
-rw-r--r--phpBB/posting.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/phpBB/posting.php b/phpBB/posting.php
index 42c4f7bc55..d690445fdb 100644
--- a/phpBB/posting.php
+++ b/phpBB/posting.php
@@ -1131,8 +1131,13 @@ if ($submit || $preview || $refresh)
$data['topic_replies'] = $post_data['topic_replies'];
}
+ // Only supply the username, when it is a guest posting or we edit and it was supplied,
+ // otherwise post_data might hold data of the post we quote, in which case
+ // username is the original poster, not the current one. See: PHPBB3-11769
+ $post_author_name = ((!$user->data['is_registered'] || $mode == 'edit') && $post_data['username']) ? $post_data['username'] : '';
+
// The last parameter tells submit_post if search indexer has to be run
- $redirect_url = submit_post($mode, $post_data['post_subject'], $post_data['username'], $post_data['topic_type'], $poll, $data, $update_message, ($update_message || $update_subject) ? true : false);
+ $redirect_url = submit_post($mode, $post_data['post_subject'], $post_author_name, $post_data['topic_type'], $poll, $data, $update_message, ($update_message || $update_subject) ? true : false);
if ($config['enable_post_confirm'] && !$user->data['is_registered'] && (isset($captcha) && $captcha->is_solved() === true) && ($mode == 'post' || $mode == 'reply' || $mode == 'quote'))
{