diff options
Diffstat (limited to 'includes/common.inc')
-rw-r--r-- | includes/common.inc | 5 |
1 files changed, 2 insertions, 3 deletions
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); } /** |