From 1dd9efb7fb65c5d8064339ec21d08328b5c6ffff Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Fri, 18 May 2007 16:10:14 +0000 Subject: [PATCH] "fixed missing encoding for ambersands by using the standard php functions htmlspecialchars and htmlspecialchars_decode" --- phpgwapi/inc/xml_functions.inc.php | 44 ++++++++---------------------- 1 file changed, 11 insertions(+), 33 deletions(-) diff --git a/phpgwapi/inc/xml_functions.inc.php b/phpgwapi/inc/xml_functions.inc.php index c9e02573c6..58b35b4f12 100644 --- a/phpgwapi/inc/xml_functions.inc.php +++ b/phpgwapi/inc/xml_functions.inc.php @@ -196,43 +196,21 @@ */ function xmlrpc_encode_entities($data) { - $convmap = array(0, 0x1F, 0, 0xFFFF, 0x80, 0xFFFF, 0, 0xFFFF); - $encoding = $GLOBALS['egw']->translation->system_charset; - mb_regex_encoding($encoding); - $pattern = array('<', '>', '"', '\''); - $replacement = array('<', '>', '"', '''); - for ($i=0; $itranslation->system_charset ? + $GLOBALS['egw']->translation->system_charset : 'latin1'); + } + + if (!function_exists('htmlspecialchars_decode')) // php < 5.1 + { + function htmlspecialchars_decode($text,$quote_style=ENT_COMPAT) + { + return strtr($text, array_flip(get_html_translation_table(HTML_SPECIALCHARS,$quote_style))); + } } function xmlrpc_entity_decode($string) { - $top = split('&', $string); - $op = ''; - $i = 0; - while($i