Merge pull request #899 from fabrixxm/issue_898
use htmlspecialchars in xmlify and htmlspecialchars_decode in unxmlify
This commit is contained in:
commit
e312b734ca
|
@ -218,14 +218,16 @@ function xmlify($str) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}*/
|
}*/
|
||||||
|
/*
|
||||||
$buffer = mb_ereg_replace("&", "&", $str);
|
$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 = mb_ereg_replace("<", "<", $buffer);
|
$buffer = mb_ereg_replace("<", "<", $buffer);
|
||||||
$buffer = mb_ereg_replace(">", ">", $buffer);
|
$buffer = mb_ereg_replace(">", ">", $buffer);
|
||||||
|
*/
|
||||||
|
$buffer = htmlspecialchars($str, ENT_QUOTES);
|
||||||
$buffer = trim($buffer);
|
$buffer = trim($buffer);
|
||||||
|
|
||||||
return($buffer);
|
return($buffer);
|
||||||
}}
|
}}
|
||||||
|
|
||||||
|
@ -238,11 +240,13 @@ if(! function_exists('unxmlify')) {
|
||||||
function unxmlify($s) {
|
function unxmlify($s) {
|
||||||
// $ret = str_replace('&','&', $s);
|
// $ret = str_replace('&','&', $s);
|
||||||
// $ret = str_replace(array('<','>','"','''),array('<','>','"',"'"),$ret);
|
// $ret = str_replace(array('<','>','"','''),array('<','>','"',"'"),$ret);
|
||||||
$ret = mb_ereg_replace('&', '&', $s);
|
/*$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);
|
||||||
$ret = mb_ereg_replace('<', "<", $ret);
|
$ret = mb_ereg_replace('<', "<", $ret);
|
||||||
$ret = mb_ereg_replace('>', ">", $ret);
|
$ret = mb_ereg_replace('>', ">", $ret);
|
||||||
|
*/
|
||||||
|
$ret = htmlspecialchars_decode($s, ENT_QUOTES);
|
||||||
return $ret;
|
return $ret;
|
||||||
}}
|
}}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue