From 66e0c0f66e02ca01e338fcd0b20e4ce132cbf682 Mon Sep 17 00:00:00 2001 From: Rory M Date: Fri, 22 Apr 2016 13:12:10 +0100 Subject: [PATCH] Fixed incorrect ordering of sanitisers `json_encode` needs to call the result of `htmlspecialchars`, not visa versa! --- api.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api.php b/api.php index b77d89a6..e9bdf0f7 100644 --- a/api.php +++ b/api.php @@ -48,5 +48,5 @@ } - echo htmlspecialchars(json_encode($data)); + echo json_encode(htmlspecialchars($data)); ?>