From 3151b4b0dc58a9d7b74a8daeda0ff24b05c439be Mon Sep 17 00:00:00 2001 From: Ripta Pasay Date: Wed, 15 Apr 2009 20:44:46 -0400 Subject: [PATCH] Don't allow spaces in the MX record content [#67] --- app/models/mx.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/models/mx.rb b/app/models/mx.rb index 3246d388..957acc27 100644 --- a/app/models/mx.rb +++ b/app/models/mx.rb @@ -14,6 +14,9 @@ class MX < Record :only_integer => true validates_presence_of :content + validates_format_of :content, + :allow_blank => true, + :with => /\A\S+\Z/ # Only accept valid IPv4 addresses def validate_with_mx