summaryrefslogtreecommitdiffstats
path: root/system/helpers/email_helper.php
diff options
context:
space:
mode:
authorEric Roberts <eric@cryode.com>2012-12-12 14:02:11 +0100
committerEric Roberts <eric@cryode.com>2012-12-12 14:02:11 +0100
commitb9e35f21e1c70b6aa67c47e9244ed83195abc00a (patch)
tree64f82db362deeac48cc20d1d1afd80651f36f5a5 /system/helpers/email_helper.php
parent0b05705c52c3bca7f9b3aee657c888e8ad1ff422 (diff)
parent545a7c86701875e1412bcde316e9bcc76d9a23a0 (diff)
Merge branch 'refs/heads/develop' into feature/form_error_msgs
Conflicts: system/language/english/form_validation_lang.php user_guide_src/source/libraries/form_validation.rst Signed-off-by: Eric Roberts <eric@cryode.com>
Diffstat (limited to 'system/helpers/email_helper.php')
-rw-r--r--system/helpers/email_helper.php39
1 files changed, 21 insertions, 18 deletions
diff --git a/system/helpers/email_helper.php b/system/helpers/email_helper.php
index 497625c10..dfb166a5a 100644
--- a/system/helpers/email_helper.php
+++ b/system/helpers/email_helper.php
@@ -1,4 +1,4 @@
-<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+<?php
/**
* CodeIgniter
*
@@ -24,6 +24,7 @@
* @since Version 1.0
* @filesource
*/
+defined('BASEPATH') OR exit('No direct script access allowed');
/**
* CodeIgniter Email Helpers
@@ -37,33 +38,35 @@
// ------------------------------------------------------------------------
-/**
- * Validate email address
- *
- * @param string
- * @return bool
- */
if ( ! function_exists('valid_email'))
{
- function valid_email($address)
+ /**
+ * Validate email address
+ *
+ * @deprecated 3.0.0 Use PHP's filter_var() instead
+ * @param string $email
+ * @return bool
+ */
+ function valid_email($email)
{
- return (bool) preg_match('/^([a-z0-9\+_\-]+)(\.[a-z0-9\+_\-]+)*@([a-z0-9\-]+\.)+[a-z]{2,6}$/ix', $address);
+ return (bool) filter_var($email, FILTER_VALIDATE_EMAIL);
}
}
// ------------------------------------------------------------------------
-/**
- * Send an email
- *
- * @param string
- * @param string
- * @param string
- * @return bool
- */
if ( ! function_exists('send_email'))
{
- function send_email($recipient, $subject = 'Test email', $message = 'Hello World')
+ /**
+ * Send an email
+ *
+ * @deprecated 3.0.0 Use PHP's mail() instead
+ * @param string $recipient
+ * @param string $subject
+ * @param string $message
+ * @return bool
+ */
+ function send_email($recipient, $subject, $message)
{
return mail($recipient, $subject, $message);
}