From 2845b153d8e86b80c6b9a8c0869474affb277516 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 23 Aug 2013 22:52:33 +0200 Subject: [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 --- phpBB/includes/functions_posting.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'phpBB/includes/functions_posting.php') 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); } -- cgit v1.2.1 From d717203af1263e552886251fbee9b718be45f623 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 23 Aug 2013 23:49:11 +0200 Subject: [ticket/11769] Fix language issues in the doc blocks PHPBB3-11769 --- phpBB/includes/functions_posting.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'phpBB/includes/functions_posting.php') diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index aff7129fce..32206df868 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -2604,9 +2604,9 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u // Send Notifications if (($mode == 'reply' || $mode == 'quote' || $mode == 'post') && $post_approval) { - // 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. + // If a username was supplied or the poster is a guest, we will use the supplied username. + // Doing it this way we can use "...post by guest-username..." in notifications when + // "guest-username" is supplied or ommit the username if it is not. $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); } -- cgit v1.2.1 From 42b9c3c479a28ba74c214676a17e7e783150e227 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 2 Sep 2013 01:11:40 +0200 Subject: [ticket/11769] Allow '0' as username PHPBB3-11769 --- phpBB/includes/functions_posting.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/includes/functions_posting.php') diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 32206df868..11a5067ef9 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -2607,7 +2607,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u // If a username was supplied or the poster is a guest, we will use the supplied username. // Doing it this way we can use "...post by guest-username..." in notifications when // "guest-username" is supplied or ommit the username if it is not. - $username = ($username || !$user->data['is_registered']) ? $username : $user->data['username']; + $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); } -- cgit v1.2.1