From 137705d20ba6f1d878e5f4378905e51c34631316 Mon Sep 17 00:00:00 2001 From: ryan Date: Tue, 22 Dec 2009 16:49:35 +0000 Subject: [PATCH] Update json lib. Use encodeUnsafe in our json wrapper. Props nacin. fixes #11537 for trunk git-svn-id: http://svn.automattic.com/wordpress/trunk@12491 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-json.php | 4 ++-- wp-includes/compat.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/wp-includes/class-json.php b/wp-includes/class-json.php index c84815c52..207c1774d 100644 --- a/wp-includes/class-json.php +++ b/wp-includes/class-json.php @@ -50,7 +50,7 @@ * @author Matt Knapp * @author Brett Stimmerman * @copyright 2005 Michal Migurski - * @version CVS: $Id: JSON.php,v 1.3 2009/05/22 23:51:00 alan_k Exp $ + * @version CVS: $Id: JSON.php 288200 2009-09-09 15:41:29Z alan_k $ * @license http://www.opensource.org/licenses/bsd-license.php * @link http://pear.php.net/pepr/pepr-proposal-show.php?id=198 */ @@ -235,7 +235,7 @@ class Services_JSON */ function encode($var) { - header('Content-type: application/x-javascript'); + header('Content-type: application/json'); return $this->_encode($var); } /** diff --git a/wp-includes/compat.php b/wp-includes/compat.php index ce7e954cb..45d746bec 100644 --- a/wp-includes/compat.php +++ b/wp-includes/compat.php @@ -133,7 +133,7 @@ if ( !function_exists('json_encode') ) { $wp_json = new Services_JSON(); } - return $wp_json->encode( $string ); + return $wp_json->encodeUnsafe( $string ); } }