summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--system/helpers/email_helper.php4
-rw-r--r--user_guide_src/source/changelog.rst1
2 files changed, 3 insertions, 2 deletions
diff --git a/system/helpers/email_helper.php b/system/helpers/email_helper.php
index 0516e938a..628667d4d 100644
--- a/system/helpers/email_helper.php
+++ b/system/helpers/email_helper.php
@@ -45,9 +45,9 @@ if ( ! function_exists('valid_email'))
* @param string
* @return bool
*/
- function valid_email($address)
+ function valid_email($email)
{
- return (bool) preg_match('/^([a-z0-9\+_\-]+)(\.[a-z0-9\+_\-]+)*@([a-z0-9\-]+\.)+[a-z]{2,6}$/ix', $address);
+ return filter_var($email, FILTER_VALIDATE_EMAIL);
}
}
diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst
index e0d745fd8..5a9bca22c 100644
--- a/user_guide_src/source/changelog.rst
+++ b/user_guide_src/source/changelog.rst
@@ -53,6 +53,7 @@ Release Date: Not Released
- do_hash() now uses PHP's native hash() function, supporting more algorithms.
- Added an optional paramater to ``delete_files()`` to enable it to skip deleting files such as .htaccess and index.html.
- Removed deprecated helper function ``js_insert_smiley()`` from smiley helper.
+ - Updated email helper to use ``filter_var`` to validate email addresses
- Database