|
|
@@ -1191,6 +1191,13 @@ class UploadHandler
|
|
|
));
|
|
|
}
|
|
|
}
|
|
|
+ if(!headers_sent()){
|
|
|
+ // this is the most likely/expected path.
|
|
|
+ header("Content-Type: text/javascript; charset=UTF-8");
|
|
|
+ } else {
|
|
|
+ // html-encode json to prevent xss...
|
|
|
+ $json = htmlentities($json, ENT_QUOTES | ENT_SUBSTITUTE | ENT_DISALLOWED | ENT_HTML401);
|
|
|
+ }
|
|
|
$this->body($json);
|
|
|
}
|
|
|
return $content;
|