summaryrefslogtreecommitdiffstats
path: root/system/helpers/email_helper.php
diff options
context:
space:
mode:
Diffstat (limited to 'system/helpers/email_helper.php')
-rw-r--r--system/helpers/email_helper.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/system/helpers/email_helper.php b/system/helpers/email_helper.php
index c7b3abada..449aadfc2 100644
--- a/system/helpers/email_helper.php
+++ b/system/helpers/email_helper.php
@@ -50,6 +50,13 @@ if ( ! function_exists('valid_email'))
*/
function valid_email($email)
{
+ // Use PHP's filters if they exist
+ if (function_exists('filter_var'))
+ {
+ return (bool) filter_var($email, FILTER_VALIDATE_EMAIL);
+ }
+
+ // Fallback based on RFC822
$qtext = '[^\\x0d\\x22\\x5c\\x80-\\xff]';
$dtext = '[^\\x0d\\x5b-\\x5d\\x80-\\xff]';