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/security_helper.php b/system/helpers/security_helper.php
index 97c9a6b..7552fd8 100644
--- a/system/helpers/security_helper.php
+++ b/system/helpers/security_helper.php
@@ -35,10 +35,13 @@
  * @param	string	the character set of your data

  * @return	string

  */	

-function xss_clean($str, $charset = 'ISO-8859-1')

+if (! function_exists('xss_clean'))

 {

-	$CI =& get_instance();

-	return $CI->input->xss_clean($str, $charset);

+	function xss_clean($str, $charset = 'ISO-8859-1')

+	{

+		$CI =& get_instance();

+		return $CI->input->xss_clean($str, $charset);

+	}

 }

 

 // --------------------------------------------------------------------

@@ -49,32 +52,35 @@
  * @access	public

  * @param	string

  * @return	string

- */		

-function dohash($str, $type = 'sha1')

-{

-	if ($type == 'sha1')

+ */	

+if (! function_exists('dohash'))

+{	

+	function dohash($str, $type = 'sha1')

 	{

-		if ( ! function_exists('sha1'))

+		if ($type == 'sha1')

 		{

-			if ( ! function_exists('mhash'))

-			{	

-				require_once(BASEPATH.'libraries/Sha1'.EXT);

-				$SH = new CI_SHA;

-				return $SH->generate($str);

+			if ( ! function_exists('sha1'))

+			{

+				if ( ! function_exists('mhash'))

+				{	

+					require_once(BASEPATH.'libraries/Sha1'.EXT);

+					$SH = new CI_SHA;

+					return $SH->generate($str);

+				}

+				else

+				{

+					return bin2hex(mhash(MHASH_SHA1, $str));

+				}

 			}

 			else

 			{

-				return bin2hex(mhash(MHASH_SHA1, $str));

-			}

+				return sha1($str);

+			}	

 		}

 		else

 		{

-			return sha1($str);

-		}	

-	}

-	else

-	{

-		return md5($str);

+			return md5($str);

+		}

 	}

 }

 	

@@ -87,12 +93,15 @@
  * @param	string

  * @return	string

  */	

-function strip_image_tags($str)

+if (! function_exists('strip_image_tags'))

 {

-	$str = preg_replace("#<img\s+.*?src\s*=\s*[\"'](.+?)[\"'].*?\>#", "\\1", $str);

-	$str = preg_replace("#<img\s+.*?src\s*=\s*(.+?).*?\>#", "\\1", $str);

+	function strip_image_tags($str)

+	{

+		$str = preg_replace("#<img\s+.*?src\s*=\s*[\"'](.+?)[\"'].*?\>#", "\\1", $str);

+		$str = preg_replace("#<img\s+.*?src\s*=\s*(.+?).*?\>#", "\\1", $str);

 			

-	return $str;

+		return $str;

+	}

 }

 	

 // ------------------------------------------------------------------------

@@ -104,9 +113,12 @@
  * @param	string

  * @return	string

  */	

-function encode_php_tags($str)

+if (! function_exists('encode_php_tags'))

 {

-	return str_replace(array('<?php', '<?PHP', '<?', '?>'),  array('&lt;?php', '&lt;?PHP', '&lt;?', '?&gt;'), $str);

+	function encode_php_tags($str)

+	{

+		return str_replace(array('<?php', '<?PHP', '<?', '?>'),  array('&lt;?php', '&lt;?PHP', '&lt;?', '?&gt;'), $str);

+	}

 }

 

 ?>
\ No newline at end of file