summaryrefslogtreecommitdiffstats
path: root/lib/json.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/json.php')
-rw-r--r--lib/json.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/json.php b/lib/json.php
index 4eab4fce9f6..c49b831c12b 100644
--- a/lib/json.php
+++ b/lib/json.php
@@ -94,12 +94,12 @@ class OC_JSON{
* Encode and print $data in json format
*/
public static function encodedPrint($data,$setContentType=true){
- if(!isset($_SERVER['PATH_INFO']) || $_SERVER['PATH_INFO'] == '') {
+ // Disable mimesniffing, don't move this to setContentTypeHeader!
+ header( 'X-Content-Type-Options: nosniff' );
if($setContentType){
self::setContentTypeHeader();
}
array_walk_recursive($data, array('OC_JSON', 'to_string'));
echo json_encode($data);
- }
}
}