Skip to content

Commit

Permalink
Bug #14063 Override default email form field validation.
Browse files Browse the repository at this point in the history
Allow any valid rfc822 email list.
  • Loading branch information
mrubinsk committed Jul 28, 2015
1 parent ae90492 commit 9310611
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion whups/lib/Form/Type/whupsemail.php
Expand Up @@ -2,4 +2,24 @@
/**
* @package Horde_Form
*/
class Whups_Form_Type_whupsemail extends Horde_Form_Type_email {}
class Whups_Form_Type_whupsemail extends Horde_Form_Type_email
{

/**
* @param string $email An individual email address to validate.
*
* @return boolean
*/
function validateEmailAddress($email)
{
$rfc = new Horde_Mail_Rfc822();
try {
$rfc->parseAddressList($email, array('validate' => true));
} catch (Horde_Mail_Exception $e) {
return false;
}

return true;
}

}

0 comments on commit 9310611

Please sign in to comment.