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
)|
(
(?<sep4>@)
- (?<identifier3>[a-z0-9_\-@\.]*)
+ (?<identifier3>[A-Za-z0-9_\-@\.]*)
)
)
(?=
"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)),