Bug #20632 » 11361_typo3ajax_json_encode.patch
typo3/classes/class.typo3ajax.php (Arbeitskopie) | ||
---|---|---|
* @return void
|
||
*/
|
||
protected function renderAsJSON() {
|
||
// if the backend does not run in UTF-8 then we need to convert it to unicode as
|
||
// the json_encode method will return empty otherwise
|
||
if ($this->charset != $this->requestCharset) {
|
||
$GLOBALS['LANG']->csConvObj->convArray($this->content, $this->charset, $this->requestCharset);
|
||
}
|
||
$content = json_encode($this->content);
|
||
header('Content-type: application/json; charset='.$this->charset);
|
||
header('Content-type: application/json; charset='.$this->requestCharset);
|
||
header('X-JSON: '.($this->contentFormat != 'jsonbody' ? $content : true));
|
||
// bring content in xhr.responseText except when in "json head only" mode
|