Skip to content

Commit

Permalink
Only call validate() if callback is a string to avoid a deprecation w…
Browse files Browse the repository at this point in the history
…arning in PHP 8.1
  • Loading branch information
W0rma committed Oct 29, 2021
1 parent 2ce46cc commit d0bf25d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion View/JsonpHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ private function getCallback(Request $request): string
$callback = $request->query->get($this->callbackParam);
$validator = new \JsonpCallbackValidator();

if (!$validator->validate($callback)) {
if (!is_string($callback) || !$validator->validate($callback)) {
throw new BadRequestHttpException('Invalid JSONP callback value');
}

Expand Down

0 comments on commit d0bf25d

Please sign in to comment.