diff --git a/app/models/prompt.rb b/app/models/prompt.rb index acf5b2963c5..531d9381d68 100755 --- a/app/models/prompt.rb +++ b/app/models/prompt.rb @@ -65,6 +65,7 @@ def inherit_from_signup before_validation :cleanup_url def cleanup_url self.url = Addressable::URI.heuristic_parse(self.url) if self.url + rescue Addressable::URI::InvalidURIError end validate :correct_number_of_tags diff --git a/app/validators/url_format_validator.rb b/app/validators/url_format_validator.rb index 4a252c0233b..a38153f99e3 100644 --- a/app/validators/url_format_validator.rb +++ b/app/validators/url_format_validator.rb @@ -8,7 +8,7 @@ def validate_each(record,attribute,value) # http (optional s) :// domain . tld (optional port) / anything regexp = /^https?:\/\/[_a-z\d\-]+\.[._a-z\d\-]+(:\d+)?\/?.+/i unless value.match regexp - record.errors.add(attribute, options[:message] || "does not appear to be a valid URL.") + record.errors.add(attribute.upcase, options[:message] || " does not appear to be a valid URL.") end end end