Permalink
Browse files

closes #182 allow fs.fed.us email addresses to register as gov

  • Loading branch information...
1 parent 2f54a06 commit 74bc61b6d1ad89f244cd3b5a2323118effb98ce4 @ajb ajb committed Feb 15, 2013
@@ -11,7 +11,7 @@ class RfpezValidator extends Laravel\Validator {
*/
protected function validate_dotgovonly($attribute, $value)
{
- return (preg_match('/\.gov$/', $value) || preg_match('/\.mil$/', $value));
+ return (preg_match('/\.gov$/', $value) || preg_match('/\.mil$/', $value) || preg_match('/\.fed.us$/', $value));
}
}
@@ -1,5 +1,5 @@
$.validator.addMethod 'dotgovonly', (value, element, param) ->
- return (value.match(new RegExp('.gov$', 'i')) || value.match(new RegExp('.mil$', 'i')))
+ return (value.match(new RegExp('.gov$', 'i')) || value.match(new RegExp('.mil$', 'i')) || value.match(new RegExp('.fed.us$', 'i')))
, "Sorry, only government email addresses are allowed."
$.validator.addMethod 'urladdhttp', (value, element) ->
@@ -1,6 +1,6 @@
$.validator.addMethod('dotgovonly', function(value, element, param) {
- return value.match(new RegExp('.gov$', 'i')) || value.match(new RegExp('.mil$', 'i'));
+ return value.match(new RegExp('.gov$', 'i')) || value.match(new RegExp('.mil$', 'i')) || value.match(new RegExp('.fed.us$', 'i'));
}, "Sorry, only government email addresses are allowed.");
$.validator.addMethod('urladdhttp', function(value, element) {
View
@@ -4899,7 +4899,7 @@ $(document).on("submit", "#ask-question-form", function(e) {
$.validator.addMethod('dotgovonly', function(value, element, param) {
- return value.match(new RegExp('.gov$', 'i')) || value.match(new RegExp('.mil$', 'i'));
+ return value.match(new RegExp('.gov$', 'i')) || value.match(new RegExp('.mil$', 'i')) || value.match(new RegExp('.fed.us$', 'i'));
}, "Sorry, only government email addresses are allowed.");
$.validator.addMethod('urladdhttp', function(value, element) {
Oops, something went wrong.

0 comments on commit 74bc61b

Please sign in to comment.