From ea933249c8acdbe43f8d54615068c881ea6b7e67 Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Sun, 16 Nov 2014 15:20:05 +0100 Subject: [PATCH] =?UTF-8?q?Task=20#1044=20-=20Implementation=20de=20Test?= =?UTF-8?q?=20Ajout=20m=C3=A9canisme=20test=20pour=20ajax?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/function_javascript.php | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/include/function_javascript.php b/include/function_javascript.php index 081f4ea65..9997f7bd8 100644 --- a/include/function_javascript.php +++ b/include/function_javascript.php @@ -2709,12 +2709,13 @@ function unescapebycharacter($str) return array($char, 0); } } -/*!\brief When data are transfered thanks ajax in a xml document, the xml +/** + * @brief When data are transfered thanks ajax in a xml document, the xml * can not contains some character, to escape those characters, we must use this * function - *\param $p_xml the xml to escape - *\return the xml string with the forbidden char escaped - *\see ajax_card.js ajaxFid + *@param $p_xml the xml to escape + *@return the xml string with the forbidden char escaped + *@see ajax_card.js ajaxFid */ function escape_xml($p_xml) { @@ -2726,6 +2727,24 @@ function escape_xml($p_xml) $xml=str_replace('"','"',$xml); return $xml; } +/** + * @brief + * replace special char + *@param $p_xml the xml to escape + *@return the xml string with the forbidden char escaped + *@see ajax_card.js ajaxFid + *@see escape_xml + */ +function unescape_xml($p_xml) +{ + $xml=$p_xml; + $xml=str_replace('&','&',$xml); + $xml=str_replace('<','<',$xml); + $xml=str_replace('>','>',$xml); + $xml=str_replace(''',"'",$xml); + $xml=str_replace('"','"',$xml); + return $xml; +} /** *load all the javascript in once */