aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/input.php
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-10-08 11:19:10 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-10-08 11:19:10 +0000
commit150d48d5f28f04bda8364ecbe092c5bb27ee4808 (patch)
tree306298b838bbd52392fcd37a37bae84359d3b5e0 /engine/lib/input.php
parent23cc2ea83e586f6bf62bdfaf05b1e2d3ba0be2ed (diff)
downloadelgg-150d48d5f28f04bda8364ecbe092c5bb27ee4808.tar.gz
elgg-150d48d5f28f04bda8364ecbe092c5bb27ee4808.tar.bz2
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
Diffstat (limited to 'engine/lib/input.php')
-rw-r--r--engine/lib/input.php10
1 files changed, 10 insertions, 0 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