diff options
author | Derek Jones <derek.jones@ellislab.com> | 2008-01-28 22:00:20 +0100 |
---|---|---|
committer | Derek Jones <derek.jones@ellislab.com> | 2008-01-28 22:00:20 +0100 |
commit | 269b942a2bf7b022795e591d9b0ad04526ee7e09 (patch) | |
tree | f465bb5a700d4cc5d72ca6e55e251640a46b869b /system/helpers/email_helper.php | |
parent | a25530f6594c7ba45b3faa9537fda9f807069759 (diff) |
added ability to "extend" helpers
* modified Loader to check for prefixed helpers in application/helpers folder
* surrounded provided helper functions with if (! function_exists('foo')) conditionals so the user's helper functions take precedent.
Diffstat (limited to 'system/helpers/email_helper.php')
-rw-r--r-- | system/helpers/email_helper.php | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/system/helpers/email_helper.php b/system/helpers/email_helper.php index b44fae554..e677afd28 100644 --- a/system/helpers/email_helper.php +++ b/system/helpers/email_helper.php @@ -33,9 +33,12 @@ * @access public
* @return bool
*/
-function valid_email($address)
+if (! function_exists('valid_email'))
{
- return ( ! preg_match("/^([a-z0-9\+_\-]+)(\.[a-z0-9\+_\-]+)*@([a-z0-9\-]+\.)+[a-z]{2,6}$/ix", $address)) ? FALSE : TRUE;
+ function valid_email($address)
+ {
+ return ( ! preg_match("/^([a-z0-9\+_\-]+)(\.[a-z0-9\+_\-]+)*@([a-z0-9\-]+\.)+[a-z]{2,6}$/ix", $address)) ? FALSE : TRUE;
+ }
}
// ------------------------------------------------------------------------
@@ -46,9 +49,12 @@ function valid_email($address) * @access public
* @return bool
*/
-function send_email($recipient, $subject = 'Test email', $message = 'Hello World')
+if (! function_exists('send_email'))
{
- return mail($recipient, $subject, $message);
+ function send_email($recipient, $subject = 'Test email', $message = 'Hello World')
+ {
+ return mail($recipient, $subject, $message);
+ }
}
?>
\ No newline at end of file |