Handle username with dots in user mentions

This commit is contained in:
Frederic Guillot
2016-12-17 12:11:17 -05:00
parent b6ea1ac9a4
commit aafa1de4d5
5 changed files with 90 additions and 38 deletions

View File

@@ -58,7 +58,8 @@ class UserMentionJob extends BaseJob
{
$users = array();
if (preg_match_all('/@([^\s,!.:?]+)/', $text, $matches)) {
if (preg_match_all('/@([^\s,!:?]+)/', $text, $matches)) {
array_walk($matches[1], function (&$username) { $username = rtrim($username, '.'); });
$users = $this->db->table(UserModel::TABLE)
->columns('id', 'username', 'name', 'email', 'language')
->eq('notifications_enabled', 1)