aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/posting.php
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@phpbb.com>2013-09-02 12:28:33 +0200
committerAndreas Fischer <bantu@phpbb.com>2013-09-02 12:28:33 +0200
commit5ab378f1ee34951c0683751d07cb8cca8a9a7bd1 (patch)
tree309522ce90a89c6551a56082023df5017094e98b /phpBB/posting.php
parentba9d303d525e3b8a12748da02080e3cbc6644a3b (diff)
parentcd9711b7c9201fa58ce56e56f85aa2c196bcbdae (diff)
downloadforums-5ab378f1ee34951c0683751d07cb8cca8a9a7bd1.tar
forums-5ab378f1ee34951c0683751d07cb8cca8a9a7bd1.tar.gz
forums-5ab378f1ee34951c0683751d07cb8cca8a9a7bd1.tar.bz2
forums-5ab378f1ee34951c0683751d07cb8cca8a9a7bd1.tar.xz
forums-5ab378f1ee34951c0683751d07cb8cca8a9a7bd1.zip
Merge remote-tracking branch 'nickvergessen/ticket/11769' into prep-release-3.0.12
* nickvergessen/ticket/11769: [ticket/11769] Allow using 0 as poster name [ticket/11769] Allow '0' as username [ticket/11769] Allow '0' as username in notification mails [ticket/11769] Fix language issues in the doc blocks [ticket/11769] Correctly supply the post author's username in posting.php
Diffstat (limited to 'phpBB/posting.php')
-rw-r--r--phpBB/posting.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/phpBB/posting.php b/phpBB/posting.php
index 42c4f7bc55..61df10b125 100644
--- a/phpBB/posting.php
+++ b/phpBB/posting.php
@@ -1131,8 +1131,14 @@ if ($submit || $preview || $refresh)
$data['topic_replies'] = $post_data['topic_replies'];
}
+ // Only return the username when it is either a guest posting or we are editing a post and
+ // the username was supplied; otherwise post_data might hold the data of the post that is
+ // being quoted (which could result in the username being returned being that of the quoted
+ // post's poster, not the poster of the current post). See: PHPBB3-11769 for more information.
+ $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'))
{