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/xml_helper.php b/system/helpers/xml_helper.php
index 1a2c737..5aa6de9 100644
--- a/system/helpers/xml_helper.php
+++ b/system/helpers/xml_helper.php
@@ -34,25 +34,27 @@
* @param string
* @return string
*/
-function xml_convert($str)
+if (! function_exists('xml_convert'))
{
- $temp = '__TEMP_AMPERSANDS__';
+ function xml_convert($str)
+ {
+ $temp = '__TEMP_AMPERSANDS__';
- // Replace entities to temporary markers so that
- // ampersands won't get messed up
- $str = preg_replace("/&#(\d+);/", "$temp\\1;", $str);
- $str = preg_replace("/&(\w+);/", "$temp\\1;", $str);
+ // Replace entities to temporary markers so that
+ // ampersands won't get messed up
+ $str = preg_replace("/&#(\d+);/", "$temp\\1;", $str);
+ $str = preg_replace("/&(\w+);/", "$temp\\1;", $str);
- $str = str_replace(array("&","<",">","\"", "'", "-"),
- array("&", "<", ">", """, "'", "-"),
- $str);
+ $str = str_replace(array("&","<",">","\"", "'", "-"),
+ array("&", "<", ">", """, "'", "-"),
+ $str);
- // Decode the temp markers back to entities
- $str = preg_replace("/$temp(\d+);/","&#\\1;",$str);
- $str = preg_replace("/$temp(\w+);/","&\\1;", $str);
+ // Decode the temp markers back to entities
+ $str = preg_replace("/$temp(\d+);/","&#\\1;",$str);
+ $str = preg_replace("/$temp(\w+);/","&\\1;", $str);
- return $str;
+ return $str;
+ }
}
-
?>
\ No newline at end of file