diff --git a/phpBB/language/en/email/mention.txt b/phpBB/language/en/email/mention.txt index 51c161453e..95bc4c8601 100644 --- a/phpBB/language/en/email/mention.txt +++ b/phpBB/language/en/email/mention.txt @@ -1,20 +1,20 @@ -Subject: Topic reply notification - "{TOPIC_TITLE}" +Subject: Topic reply notification - "{{ TOPIC_TITLE }}" -Hello {USERNAME}, +Hello {{ USERNAME }}, -You are receiving this notification because "{AUTHOR_NAME}" mentioned you in the topic "{TOPIC_TITLE}" at "{SITENAME}". You can use the following link to view the reply made. +You are receiving this notification because "{{ AUTHOR_NAME }}" mentioned you in the topic "{{ TOPIC_TITLE }}" at "{{ SITENAME }}". You can use the following link to view the reply made. If you want to view the post where you have been mentioned, click the following link: -{U_VIEW_POST} +{{ U_VIEW_POST }} If you want to view the topic, click the following link: -{U_TOPIC} +{{ U_TOPIC }} If you want to view the forum, click the following link: -{U_FORUM} +{{ U_FORUM }} If you no longer wish to receive updates about replies mentioning you, please update your notification settings here: -{U_NOTIFICATION_SETTINGS} +{{ U_NOTIFICATION_SETTINGS }} -{EMAIL_SIG} +{{ EMAIL_SIG }} diff --git a/phpBB/phpbb/mention/controller/mention.php b/phpBB/phpbb/mention/controller/mention.php index 0aa08e090b..6548a8a995 100644 --- a/phpBB/phpbb/mention/controller/mention.php +++ b/phpBB/phpbb/mention/controller/mention.php @@ -14,6 +14,7 @@ namespace phpbb\mention\controller; use Symfony\Component\HttpFoundation\JsonResponse; +use Symfony\Component\HttpFoundation\RedirectResponse; class mention { @@ -45,7 +46,7 @@ class mention { // if (!$this->request->is_ajax()) // { -// redirect(append_sid($this->phpbb_root_path . 'index.' . $this->php_ext)); +// new RedirectResponse(append_sid($this->phpbb_root_path . 'index.' . $this->php_ext)); // } $keyword = $this->request->variable('keyword', '', true); diff --git a/phpBB/phpbb/mention/source/base_group.php b/phpBB/phpbb/mention/source/base_group.php index 9a8c70695c..b8d6c44091 100644 --- a/phpBB/phpbb/mention/source/base_group.php +++ b/phpBB/phpbb/mention/source/base_group.php @@ -33,6 +33,9 @@ abstract class base_group implements source_interface /** @var string */ protected $php_ext; + /** @var array Fetched groups' data */ + protected $groups = null; + /** * Constructor */ @@ -58,9 +61,7 @@ abstract class base_group implements source_interface */ protected function get_groups() { - static $groups = null; - - if (is_null($groups)) + if (is_null($this->groups)) { $query = $this->db->sql_build_query('SELECT', [ 'SELECT' => 'g.*, ug.user_id as ug_user_id', @@ -76,7 +77,7 @@ abstract class base_group implements source_interface ]); $result = $this->db->sql_query($query); - $groups = []; + $this->groups = []; while ($row = $this->db->sql_fetchrow($result)) { if ($row['group_type'] == GROUP_SPECIAL && !in_array($row['group_name'], ['ADMINISTRATORS', 'GLOBAL_MODERATORS']) || $row['group_type'] == GROUP_HIDDEN && !$this->auth->acl_gets('a_group', 'a_groupadd', 'a_groupdel') && $row['ug_user_id'] != $this->user->data['user_id']) @@ -86,14 +87,14 @@ abstract class base_group implements source_interface } $group_name = $this->helper->get_name($row['group_name']); - $groups['names'][$row['group_id']] = $group_name; - $groups[$row['group_id']] = $row; - $groups[$row['group_id']]['group_name'] = $group_name; + $this->groups['names'][$row['group_id']] = $group_name; + $this->groups[$row['group_id']] = $row; + $this->groups[$row['group_id']]['group_name'] = $group_name; } $this->db->sql_freeresult($result); } - return $groups; + return $this->groups; } /**