From b8d05419555988f3b49430ce3d8b27bb82835775 Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Tue, 13 Apr 2021 03:04:51 +0000 Subject: [PATCH] Fix user link using @ not working at the end of line (#34894). Patch by Marius BALTEANU. git-svn-id: http://svn.redmine.org/redmine/trunk@20936 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/helpers/application_helper.rb | 2 +- test/helpers/application_helper_test.rb | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 7c77a14df..25df205f8 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1283,7 +1283,7 @@ module ApplicationHelper )| ( (?@) - (?[A-Za-z0-9_\-@\.]*) + (?[A-Za-z0-9_\-@\.]*?) ) ) (?= diff --git a/test/helpers/application_helper_test.rb b/test/helpers/application_helper_test.rb index 106820999..730023443 100644 --- a/test/helpers/application_helper_test.rb +++ b/test/helpers/application_helper_test.rb @@ -521,6 +521,7 @@ class ApplicationHelperTest < Redmine::HelperTest 'user:JSMITH' => link_to_user(User.find_by_id(2)), 'user#2' => link_to_user(User.find_by_id(2)), '@jsmith' => link_to_user(User.find_by_id(2)), + '@jsmith.' => "#{link_to_user(User.find_by_id(2))}.", '@JSMITH' => link_to_user(User.find_by_id(2)), '@abcd@example.com' => link_to_user(User.find_by_id(u_email_id)), 'user:abcd@example.com' => link_to_user(User.find_by_id(u_email_id)),