aurjson: Allow underscores in JSONP callback names

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
This commit is contained in:
Lukas Fleischer 2015-10-24 18:03:19 +02:00
parent 8c87b1df0c
commit a2cbc7f646

View file

@ -119,7 +119,7 @@ class AurJSON {
if (isset($http_data['callback'])) { if (isset($http_data['callback'])) {
$callback = $http_data['callback']; $callback = $http_data['callback'];
if (!preg_match('/^[a-zA-Z0-9().]{1,128}$/D', $callback)) { if (!preg_match('/^[a-zA-Z0-9()_.]{1,128}$/D', $callback)) {
return $this->json_error('Invalid callback name.'); return $this->json_error('Invalid callback name.');
} }
header('content-type: text/javascript'); header('content-type: text/javascript');