Skip to content

Commit

Permalink
Merge branch 'prep-release-3.0.12' into develop-olympus
Browse files Browse the repository at this point in the history
* prep-release-3.0.12:
  [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

Conflicts:
	phpBB/language/en/email/forum_notify.txt
	phpBB/language/en/email/newtopic_notify.txt
	phpBB/language/en/email/topic_notify.txt
  • Loading branch information
bantu committed Sep 2, 2013
2 parents fe12093 + 5ab378f commit 68555d2
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 5 deletions.
5 changes: 4 additions & 1 deletion phpBB/includes/functions_posting.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 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);
}

Expand Down
2 changes: 1 addition & 1 deletion phpBB/language/en/email/forum_notify.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Subject: Forum post notification - "{FORUM_NAME}"

Hello {USERNAME},

You are receiving this notification because you are watching the forum "{FORUM_NAME}" at "{SITENAME}". This forum has received a new reply to the topic "{TOPIC_TITLE}"<!-- IF AUTHOR_NAME --> by {AUTHOR_NAME}<!-- ENDIF --> since your last visit. You can use the following link to view the last unread reply, no more notifications will be sent until you visit the topic.
You are receiving this notification because you are watching the forum "{FORUM_NAME}" at "{SITENAME}". This forum has received a new reply to the topic "{TOPIC_TITLE}"<!-- IF AUTHOR_NAME !== '' --> by {AUTHOR_NAME}<!-- ENDIF --> since your last visit. You can use the following link to view the last unread reply, no more notifications will be sent until you visit the topic.

{U_NEWEST_POST}

Expand Down
2 changes: 1 addition & 1 deletion phpBB/language/en/email/newtopic_notify.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Subject: New topic notification - "{FORUM_NAME}"

Hello {USERNAME},

You are receiving this notification because you are watching the forum "{FORUM_NAME}" at "{SITENAME}". This forum has received a new topic<!-- IF AUTHOR_NAME --> by {AUTHOR_NAME}<!-- ENDIF --> since your last visit, "{TOPIC_TITLE}". You can use the following link to view the forum, no more notifications will be sent until you visit the forum.
You are receiving this notification because you are watching the forum "{FORUM_NAME}" at "{SITENAME}". This forum has received a new topic<!-- IF AUTHOR_NAME !== '' --> by {AUTHOR_NAME}<!-- ENDIF --> since your last visit, "{TOPIC_TITLE}". You can use the following link to view the forum, no more notifications will be sent until you visit the forum.

{U_FORUM}

Expand Down
2 changes: 1 addition & 1 deletion phpBB/language/en/email/topic_notify.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Subject: Topic reply notification - "{TOPIC_TITLE}"

Hello {USERNAME},

You are receiving this notification because you are watching the topic "{TOPIC_TITLE}" at "{SITENAME}". This topic has received a reply<!-- IF AUTHOR_NAME --> by {AUTHOR_NAME}<!-- ENDIF --> since your last visit. You can use the following link to view the replies made, no more notifications will be sent until you visit the topic.
You are receiving this notification because you are watching the topic "{TOPIC_TITLE}" at "{SITENAME}". This topic has received a reply<!-- IF AUTHOR_NAME !== '' --> by {AUTHOR_NAME}<!-- ENDIF --> since your last visit. You can use the following link to view the replies made, no more notifications will be sent until you visit the topic.

If you want to view the newest post made since your last visit, click the following link:
{U_NEWEST_POST}
Expand Down
8 changes: 7 additions & 1 deletion phpBB/posting.php
Original file line number Diff line number Diff line change
Expand Up @@ -1131,8 +1131,14 @@
$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'))
{
Expand Down

0 comments on commit 68555d2

Please sign in to comment.