From 92efec6e1e23512e37bab2a6a3e0f979324f1e11 Mon Sep 17 00:00:00 2001 From: Angie Byron Date: Sat, 9 Jan 2010 23:36:55 +0000 Subject: #479368 by Heine and asimmonds: Fixed drupal_to_js() provides bad unicode conversions. --- includes/common.inc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'includes/common.inc') diff --git a/includes/common.inc b/includes/common.inc index 080caab1b..ecfd1a4a7 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -4389,7 +4389,7 @@ function drupal_clear_js_cache() { */ function drupal_json_encode($var) { // json_encode() does not escape <, > and &, so we do it with str_replace(). - return str_replace(array('<', '>', '&'), array('\x3c', '\x3e', '\x26'), json_encode($var)); + return str_replace(array('<', '>', '&'), array('\u003c', '\u003e', '\u0026'), json_encode($var)); } /** @@ -4399,8 +4399,7 @@ function drupal_json_encode($var) { * @ingroup php_wrappers */ function drupal_json_decode($var) { - // json_decode() does not unescape <, > and &, so we do it with str_replace(). - return json_decode(str_replace(array('\x3c', '\x3e', '\x26'), array('<', '>', '&'), $var), TRUE); + return json_decode($var, TRUE); } /** -- cgit v1.2.3