aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engine/lib/input.php10
-rw-r--r--engine/lib/users.php20
2 files changed, 10 insertions, 20 deletions
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
@@ -107,6 +107,16 @@ function sanitise_filepath($path, $append_slash = TRUE) {
}
/**
+ * 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.
*
* @param $page
diff --git a/engine/lib/users.php b/engine/lib/users.php
index 05311ab9d..c9add2541 100644
--- a/engine/lib/users.php
+++ b/engine/lib/users.php
@@ -875,26 +875,6 @@ function elgg_user_resetpassword_page_handler($page) {
}
/**
- * Validates an email address.
- *
- * @param string $address Email address.
- * @return bool
- */
-function is_email_address($address) {
- // @todo Make this better!
-
- if (strpos($address, '@')=== false) {
- return false;
- }
-
- if (strpos($address, '.')=== false) {
- return false;
- }
-
- return true;
-}
-
-/**
* Simple function that will generate a random clear text password suitable for feeding into generate_user_password().
*
* @see generate_user_password