From 150d48d5f28f04bda8364ecbe092c5bb27ee4808 Mon Sep 17 00:00:00 2001 From: cash Date: Fri, 8 Oct 2010 11:19:10 +0000 Subject: Fixes #2161 - using filter_var() in email validation and moved is_email_address() to the input library git-svn-id: http://code.elgg.org/elgg/trunk@7036 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/input.php | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'engine/lib/input.php') diff --git a/engine/lib/input.php b/engine/lib/input.php index 17a330851..324b0cec4 100644 --- a/engine/lib/input.php +++ b/engine/lib/input.php @@ -106,6 +106,16 @@ function sanitise_filepath($path, $append_slash = TRUE) { return $path; } +/** + * Validates an email address. + * + * @param string $address Email address. + * @return bool + */ +function is_email_address($address) { + return filter_var($address, FILTER_VALIDATE_EMAIL) === $address; +} + /** * Page handler for autocomplete endpoint. * -- cgit v1.2.3