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.
diff --git a/system/helpers/email_helper.php b/system/helpers/email_helper.php
index b44fae5..e677afd 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 @@
* @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