mirror of
https://github.com/internetee/registry.git
synced 2025-07-21 10:16:01 +02:00
Merge branch '108963480-model_validation' into staging
This commit is contained in:
commit
729830f9dd
1 changed files with 4 additions and 2 deletions
|
@ -228,8 +228,10 @@ class Contact < ActiveRecord::Base
|
|||
|
||||
c_name = column.name
|
||||
val = read_attribute(c_name)
|
||||
errors.add(c_name, :invalid) if val.include?('<') || val.include?('>') || val.include?('%3C') || val.include?('%3E')
|
||||
return
|
||||
if val && (val.include?('<') || val.include?('>') || val.include?('%3C') || val.include?('%3E'))
|
||||
errors.add(c_name, :invalid)
|
||||
return # want to run code faster
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue