]> source.dussan.org Git - redmine.git/commitdiff
Fix user link using @ not working at the end of line (#34894).
authorGo MAEDA <maeda@farend.jp>
Tue, 13 Apr 2021 03:04:51 +0000 (03:04 +0000)
committerGo MAEDA <maeda@farend.jp>
Tue, 13 Apr 2021 03:04:51 +0000 (03:04 +0000)
Patch by Marius BALTEANU.

git-svn-id: http://svn.redmine.org/redmine/trunk@20936 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/helpers/application_helper.rb
test/helpers/application_helper_test.rb

index 7c77a14dfea62f18ea17fb3b78a5fc004cc44f11..25df205f89d9c044b53c55bbd5d901454a30ccb6 100644 (file)
@@ -1283,7 +1283,7 @@ module ApplicationHelper
               )|
               (
               (?<sep4>@)
-              (?<identifier3>[A-Za-z0-9_\-@\.]*)
+              (?<identifier3>[A-Za-z0-9_\-@\.]*?)
               )
             )
             (?=
index 106820999da97ad11e087ecb3c9a6bd65459f7dd..730023443c456df285f0d7da65501dd3e4af6c93 100644 (file)
@@ -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)),