From 4df39487d04c1f2c00315f672026d4474ecb4a65 Mon Sep 17 00:00:00 2001 From: markjcrane Date: Sun, 20 Dec 2015 22:36:34 -0700 Subject: [PATCH] Test if email_validate function exists and fix change the indentation from spaces to tabs. --- resources/functions.php | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/resources/functions.php b/resources/functions.php index ec2140d1a2..a4155d7ccc 100644 --- a/resources/functions.php +++ b/resources/functions.php @@ -1326,17 +1326,19 @@ function number_pad($number,$n) { } //email validate - function email_validate($strEmail){ - $validRegExp = '/^[a-zA-Z0-9\._-]+@[a-zA-Z0-9\._-]+\.[a-zA-Z]{2,3}$/'; - // search email text for regular exp matches - preg_match($validRegExp, $strEmail, $matches, PREG_OFFSET_CAPTURE); + if (!function_exists('email_validate')) { + function email_validate($strEmail){ + $validRegExp = '/^[a-zA-Z0-9\._-]+@[a-zA-Z0-9\._-]+\.[a-zA-Z]{2,3}$/'; + // search email text for regular exp matches + preg_match($validRegExp, $strEmail, $matches, PREG_OFFSET_CAPTURE); - if (count($matches) == 0) { - return 0; - } - else { - return 1; - } -} + if (count($matches) == 0) { + return 0; + } + else { + return 1; + } + } + } ?>