]> source.dussan.org Git - redmine.git/commitdiff
Link to user in wiki syntax only works when login is written in lower case (#26892).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 23 Sep 2018 14:55:35 +0000 (14:55 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 23 Sep 2018 14:55:35 +0000 (14:55 +0000)
Patch by Marius BALTEANU and Go MAEDA.

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

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

index 41928753322f215ff5b4a6decf7da6a24d77ff0b..62987ca29c9b9f77d526f754a3d090dbd4800eff 100644 (file)
@@ -1025,12 +1025,12 @@ module ApplicationHelper
                 link = link_to_project(p, {:only_path => only_path}, :class => 'project')
               end
             when 'user'
-              u = User.visible.where(:login => name, :type => 'User').first
+              u = User.visible.where("LOWER(login) = :s AND type = 'User'", :s => name.downcase).first
               link = link_to_user(u, :only_path => only_path) if u
             end
           elsif sep == "@"
             name = remove_double_quotes(identifier)
-            u = User.visible.where(:login => name, :type => 'User').first
+            u = User.visible.where("LOWER(login) = :s AND type = 'User'", :s => name.downcase).first
             link = link_to_user(u, :only_path => only_path) if u
           end
         end
@@ -1067,7 +1067,7 @@ module ApplicationHelper
               )|
               (
               (?<sep4>@)
-              (?<identifier3>[a-z0-9_\-@\.]*)
+              (?<identifier3>[A-Za-z0-9_\-@\.]*)
               )
             )
             (?=
index fd0886c808ffe07d523a39a46c906146f9284834..d4990d39f363b4b961df24b9ab96d57bcf7b3cb4 100644 (file)
@@ -403,8 +403,10 @@ RAW
       "http://foo.bar/FAQ#3"        => '<a class="external" href="http://foo.bar/FAQ#3">http://foo.bar/FAQ#3</a>',
       # user
       'user:jsmith'                 => link_to_user(User.find_by_id(2)),
+      '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)),
       '@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)),
       '@foo.bar@example.com'        => link_to_user(User.find_by_id(u_email_id_2)),