Skip to content

Commit

Permalink
Merge pull request #1705 from NatLibFi/fix-rest-callback-quotes-skosm…
Browse files Browse the repository at this point in the history
…os-2

Don't HTML encode quotes in REST API callback, to fix ONKI Selector (Skosmos 2)
  • Loading branch information
osma authored Oct 29, 2024
2 parents 99e134f + 68d90a4 commit 6073feb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion controller/RestController.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ private function returnJson($data)
// wrap with JSONP callback if requested
if (filter_input(INPUT_GET, 'callback', FILTER_SANITIZE_FULL_SPECIAL_CHARS)) {
header("Content-type: application/javascript; charset=utf-8");
echo filter_input(INPUT_GET, 'callback', FILTER_SANITIZE_FULL_SPECIAL_CHARS) . "(" . json_encode($data) . ");";
echo filter_input(INPUT_GET, 'callback', FILTER_SANITIZE_FULL_SPECIAL_CHARS, FILTER_FLAG_NO_ENCODE_QUOTES) . "(" . json_encode($data) . ");";
return;
}

Expand Down

0 comments on commit 6073feb

Please sign in to comment.