We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c571d2f commit 69e66eaCopy full SHA for 69e66ea
demos/autocomplete/search.php
@@ -586,7 +586,10 @@
586
$output = json_encode($result);
587
588
if ($_GET["callback"]) {
589
- $output = $_GET["callback"] . "($output);";
+ // Escape special characters to avoid XSS attacks via direct loads of this
590
+ // page with a callback that contains HTML. This is a lot easier than validating
591
+ // the callback name.
592
+ $output = htmlspecialchars($_GET["callback"]) . "($output);";
593
}
594
595
echo $output;
0 commit comments