mirror of
https://github.com/internetee/registry.git
synced 2025-07-22 10:45:58 +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
|
c_name = column.name
|
||||||
val = read_attribute(c_name)
|
val = read_attribute(c_name)
|
||||||
errors.add(c_name, :invalid) if val.include?('<') || val.include?('>') || val.include?('%3C') || val.include?('%3E')
|
if val && (val.include?('<') || val.include?('>') || val.include?('%3C') || val.include?('%3E'))
|
||||||
return
|
errors.add(c_name, :invalid)
|
||||||
|
return # want to run code faster
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue