Limit regex matches to within word boundaries

This commit is contained in:
Seth Ringling 2017-04-13 14:46:18 -07:00 committed by Seth Ringling
parent 1e35f201b4
commit 5f97512dd1
No known key found for this signature in database
GPG Key ID: 3F8B3402E1446BE7
1 changed files with 6 additions and 6 deletions

View File

@ -552,12 +552,12 @@ module SimpleForm
:datetime
when :string, :citext, nil
case attribute_name.to_s
when /password/ then :password
when /time_zone/ then :time_zone
when /country/ then :country
when /email/ then :email
when /phone/ then :tel
when /url/ then :url
when /\bpassword\b/ then :password
when /\btime_zone\b/ then :time_zone
when /\bcountry\b/ then :country
when /\bemail\b/ then :email
when /\bphone\b/ then :tel
when /\burl\b/ then :url
else
file_method?(attribute_name) ? :file : (input_type || :string)
end