Commit ad35cfa8 authored by Gábor Hojtsy's avatar Gábor Hojtsy

Issue #341588 by voxpelli, mikl, Albert Volkman, dawehner: use the right JSON...

Issue #341588 by voxpelli, mikl, Albert Volkman, dawehner: use the right JSON MIME type in drupal_json()
parent dbf4a60b
......@@ -2572,8 +2572,8 @@ function drupal_to_js($var) {
* (optional) If set, the variable will be converted to JSON and output.
*/
function drupal_json($var = NULL) {
// We are returning JavaScript, so tell the browser.
drupal_set_header('Content-Type: text/javascript; charset=utf-8');
// We are returning JSON, so tell the browser.
drupal_set_header('Content-Type: application/json');
if (isset($var)) {
echo drupal_to_js($var);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment