aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions_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/includes/functions_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/includes/functions_posting.php')
-rw-r--r--phpBB/includes/functions_posting.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php
index 2e5130c5b8..aff7129fce 100644
--- a/phpBB/includes/functions_posting.php
+++ b/phpBB/includes/functions_posting.php
@@ -2604,7 +2604,10 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
// Send Notifications
if (($mode == 'reply' || $mode == 'quote' || $mode == 'post') && $post_approval)
{
- $username = ($username) ? $username : $user->data['username'];
+ // If a username was supplied or the poster is a guest, we use the supplied username.
+ // This way we will use "...post by guest-username..." in notifications,
+ // when guest-username was supplied and ommit the username-part otherwise.
+ $username = ($username || !$user->data['is_registered']) ? $username : $user->data['username'];
user_notification($mode, $subject, $data['topic_title'], $data['forum_name'], $data['forum_id'], $data['topic_id'], $data['post_id'], $username);
}