Prevent XSS exploit by checking if path-info is set, thanks to Lukas Reschke

This commit is contained in:
Michael Gapczynski 2012-05-10 10:26:12 -04:00
parent e3f452cf53
commit d9fbdae758

View file

@ -73,9 +73,11 @@ class OC_JSON{
* Encode and print $data in json format
*/
public static function encodedPrint($data,$setContentType=true){
if($setContentType){
self::setContentTypeHeader();
if(!isset($_SERVER['PATH_INFO'])) {
if($setContentType){
self::setContentTypeHeader();
}
echo json_encode($data);
}
echo json_encode($data);
}
}