Fix not recognizing CSRF token submitted as part of JSON body

This commit is contained in:
Kijin Sung 2022-07-25 14:05:01 +09:00
parent 9372cdc4bb
commit 1e27bae404

View file

@ -1203,11 +1203,16 @@ class Context
foreach($params as $key => $val)
{
if ($val !== '' && !isset($request_args[$key]))
if ($val !== '' && $val !== null && !isset($request_args[$key]))
{
$request_args[$key] = $val;
}
}
if (!empty($params['_rx_csrf_token']) && !isset($_REQUEST['_rx_csrf_token']))
{
$_REQUEST['_rx_csrf_token'] = $params['_rx_csrf_token'];
}
}
// Filter all arguments and set them to Context.