diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-01-09 23:36:55 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-01-09 23:36:55 +0000 |
commit | 92efec6e1e23512e37bab2a6a3e0f979324f1e11 (patch) | |
tree | 2fdcc7e3357dd0f37c9e0032b26b8d47229973e7 /includes/common.inc | |
parent | 059d9eb62589d5bf6585c6a991e07b6fc8df544b (diff) | |
download | brdo-92efec6e1e23512e37bab2a6a3e0f979324f1e11.tar.gz brdo-92efec6e1e23512e37bab2a6a3e0f979324f1e11.tar.bz2 |
#479368 by Heine and asimmonds: Fixed drupal_to_js() provides bad unicode conversions.
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); } /** |