- Patch #341588 by voxpelli, mikl, dereine: drupal_json_output() must use correct mime-type.

merge-requests/26/head
Dries Buytaert 2010-05-04 14:55:22 +00:00
parent 648d8ab87e
commit d30e1588cf
1 changed files with 2 additions and 2 deletions

View File

@ -4332,8 +4332,8 @@ function drupal_json_decode($var) {
* (optional) If set, the variable will be converted to JSON and output.
*/
function drupal_json_output($var = NULL) {
// We are returning JavaScript, so tell the browser.
drupal_add_http_header('Content-Type', 'text/javascript; charset=utf-8');
// We are returning JSON, so tell the browser.
drupal_add_http_header('Content-Type', 'application/json');
if (isset($var)) {
echo drupal_json_encode($var);