Skip to content

Commit 4a27f65

Browse files
committed
Update json lib. Use encodeUnsafe in our json wrapper. Props nacin. fixes WordPress#11537 for trunk
git-svn-id: https://develop.svn.wordpress.org/trunk@12491 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 9ff3011 commit 4a27f65

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

wp-includes/class-json.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
* @author Matt Knapp <mdknapp[at]gmail[dot]com>
5151
* @author Brett Stimmerman <brettstimmerman[at]gmail[dot]com>
5252
* @copyright 2005 Michal Migurski
53-
* @version CVS: $Id: JSON.php,v 1.3 2009/05/22 23:51:00 alan_k Exp $
53+
* @version CVS: $Id: JSON.php 288200 2009-09-09 15:41:29Z alan_k $
5454
* @license http://www.opensource.org/licenses/bsd-license.php
5555
* @link http://pear.php.net/pepr/pepr-proposal-show.php?id=198
5656
*/
@@ -235,7 +235,7 @@ function utf82utf16($utf8)
235235
*/
236236
function encode($var)
237237
{
238-
header('Content-type: application/x-javascript');
238+
header('Content-type: application/json');
239239
return $this->_encode($var);
240240
}
241241
/**

wp-includes/compat.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ function json_encode( $string ) {
133133
$wp_json = new Services_JSON();
134134
}
135135

136-
return $wp_json->encode( $string );
136+
return $wp_json->encodeUnsafe( $string );
137137
}
138138
}
139139

0 commit comments

Comments
 (0)