summaryrefslogtreecommitdiffstats
path: root/lib/redmine/acts
diff options
context:
space:
mode:
authorMarius Balteanu <marius.balteanu@zitec.com>2022-06-20 15:17:00 +0000
committerMarius Balteanu <marius.balteanu@zitec.com>2022-06-20 15:17:00 +0000
commit3e12fc1831fba8026e6988b552b24a1918307c5e (patch)
tree8df10887ebfca727bced3c5f0f1186a0f432c486 /lib/redmine/acts
parent9713c6b270ab5436c3ceda5e70640eaef15fc7f3 (diff)
downloadredmine-3e12fc1831fba8026e6988b552b24a1918307c5e.tar.gz
redmine-3e12fc1831fba8026e6988b552b24a1918307c5e.zip
Merged r21660 to 5.0-stable (#37138).
git-svn-id: https://svn.redmine.org/redmine/branches/5.0-stable@21665 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib/redmine/acts')
-rw-r--r--lib/redmine/acts/mentionable.rb19
1 files changed, 10 insertions, 9 deletions
diff --git a/lib/redmine/acts/mentionable.rb b/lib/redmine/acts/mentionable.rb
index 264d1f50b..1629bbe41 100644
--- a/lib/redmine/acts/mentionable.rb
+++ b/lib/redmine/acts/mentionable.rb
@@ -90,19 +90,20 @@ module Redmine
content = content.gsub(%r{(~~~|```)(.*?)(~~~|```)}m, '')
end
- users = content.scan(MENTION_PATTERN).flatten
+ content.scan(MENTION_PATTERN).flatten
end
MENTION_PATTERN = /
- (?:^|\W) # beginning of string or non-word char
- @((?>[a-z0-9][a-z0-9-]*)) # @username
- (?!\/) # without a trailing slash
+ (?:^|\W)
+ @([A-Za-z0-9_\-@\.]*?)
(?=
- \.+[ \t\W]| # dots followed by space or non-word character
- \.+$| # dots at end of line
- [^0-9a-zA-Z_.]| # non-word character except dot
- $ # end of line
- )
+ (?=[[:punct:]][^A-Za-z0-9_\/])|
+ ,|
+ \.+$|
+ \s|
+ \]|
+ <|
+ $)
/ix
end
end