From 385a36138a13f3727fdfb5426d81657375fbb7f1 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Tue, 12 Dec 2017 20:52:28 -0500 Subject: [PATCH] Format valid_email function in include/text --- include/text.php | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/include/text.php b/include/text.php index d25b41ae88..b246623a3a 100644 --- a/include/text.php +++ b/include/text.php @@ -1068,17 +1068,14 @@ function search($s, $id = 'search-box', $url = 'search', $save = false, $aside = } /** - * Check if $x is a valid email string + * @brief Check for a valid email string * - * @param string $x + * @param string $email_address * @return boolean */ -function valid_email($x){ - - /// @TODO Removed because Fabio told me so. - //if (Config::get('system','disable_email_validation')) - // return true; - return preg_match('/^[_a-zA-Z0-9\-\+]+(\.[_a-zA-Z0-9\-\+]+)*@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)+$/', $x); +function valid_email($email_address) +{ + return preg_match('/^[_a-zA-Z0-9\-\+]+(\.[_a-zA-Z0-9\-\+]+)*@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)+$/', $email_address); }