From 269b942a2bf7b022795e591d9b0ad04526ee7e09 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Mon, 28 Jan 2008 21:00:20 +0000 Subject: 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. --- system/helpers/email_helper.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'system/helpers/email_helper.php') 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 -- cgit v1.2.3-24-g4f1b