if(! function_exists('xmlify')) {
function xmlify($str) {
- $buffer = '';
+/* $buffer = '';
$len = mb_strlen($str);
for($x = 0; $x < $len; $x ++) {
$buffer .= $char;
break;
}
- }
+ }*/
+
+ $buffer = mb_ereg_replace("&", "&", $str);
+ $buffer = mb_ereg_replace("'", "'", $buffer);
+ $buffer = mb_ereg_replace("\"", """, $buffer);
+ $buffer = mb_ereg_replace("<", "<", $buffer);
+ $buffer = mb_ereg_replace(">", ">", $buffer);
+
$buffer = trim($buffer);
return($buffer);
}}
if(! function_exists('unxmlify')) {
function unxmlify($s) {
- $ret = str_replace('&','&', $s);
- $ret = str_replace(array('<','>','"','''),array('<','>','"',"'"),$ret);
+// $ret = str_replace('&','&', $s);
+// $ret = str_replace(array('<','>','"','''),array('<','>','"',"'"),$ret);
+ $ret = mb_ereg_replace('&', '&', $s);
+ $ret = mb_ereg_replace(''', "'", $ret);
+ $ret = mb_ereg_replace('"', '"', $ret);
+ $ret = mb_ereg_replace('<', "<", $ret);
+ $ret = mb_ereg_replace('>', ">", $ret);
return $ret;
}}