Skip to content
Snippets Groups Projects
Unverified Commit 3dd26604 authored by Tim van Dijen's avatar Tim van Dijen Committed by GitHub
Browse files

Use sanitized request-data

Silence scrutinizer
parent d9ec7129
No related branches found
No related tags found
No related merge requests found
...@@ -17,12 +17,12 @@ if (!is_array($tabs)) { ...@@ -17,12 +17,12 @@ if (!is_array($tabs)) {
// handle JSON vs JSONP requests // handle JSON vs JSONP requests
if (isset($_REQUEST['callback'])) { if (isset($_REQUEST['callback'])) {
if (!preg_match('/^[a-z0-9_]+$/i', $_REQUEST['callback'])) { if (!preg_match('/^[a-z0-9_]+$/i', $_REQUEST['callback'], $matches)) {
throw new \SimpleSAML\Error\Exception('Unsafe JSONP callback function name "'.$_REQUEST['callback'].'"'); throw new \SimpleSAML\Error\Exception('Unsafe JSONP callback function name "'.$matches[0].'"');
} }
$jsonp = true; $jsonp = true;
header('Content-Type: application/javascript'); header('Content-Type: application/javascript');
echo addslashes($_REQUEST['callback']) . '('; echo addslashes($matches[0]).'(';
} else { } else {
$jsonp = false; $jsonp = false;
header('Content-Type: application/json'); header('Content-Type: application/json');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment