Commit 2cdd0e28 authored by alexpott's avatar alexpott

Issue #2343043 by cilefen, hussainweb: valid_email_address() should use...

Issue #2343043 by cilefen, hussainweb: valid_email_address() should use egulias/EmailValidator and become deprecated
parent fca50d2c
......@@ -1178,3 +1178,5 @@ services:
renderer:
class: Drupal\Core\Render\Renderer
arguments: ['@controller_resolver', '@theme.manager', '@plugin.manager.element_info', '@request_stack', '@cache_factory', '@cache_contexts']
email.validator:
class: Egulias\EmailValidator\EmailValidator
......@@ -248,17 +248,17 @@ function drupal_get_destination() {
/**
* Verifies the syntax of the given email address.
*
* This uses the
* @link http://php.net/manual/filter.filters.validate.php PHP email validation filter. @endlink
*
* @param $mail
* @param string $mail
* A string containing an email address.
*
* @return
* @return bool
* TRUE if the address is in a valid format.
*
* @deprecated in Drupal 8.0.x-dev, will be removed before Drupal 9.0.0.
* Use \Drupal::service('email.validator')->isValid().
*/
function valid_email_address($mail) {
return (bool)filter_var($mail, FILTER_VALIDATE_EMAIL);
return \Drupal::service('email.validator')->isValid($mail);
}
/**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment