Permalink
Browse files

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

…Reschke
  • Loading branch information...
MTGap committed May 10, 2012
1 parent e3f452c commit d9fbdae75801d00227b0295b56f997c5af00e899
Showing with 5 additions and 3 deletions.
  1. +5 −3 lib/json.php
View
@@ -73,9 +73,11 @@ public static function success($data = array()){
* 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);
}
}

0 comments on commit d9fbdae

Please sign in to comment.