Skip to content

Commit

Permalink
Prevent XSS exploit by checking if path-info is set, thanks to Lukas …
Browse files Browse the repository at this point in the history
…Reschke
  • Loading branch information
MTGap committed May 10, 2012
1 parent e3f452c commit d9fbdae
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/json.php
Expand Up @@ -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.