mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-09 03:32:00 +09:00
Fix CSRF check for GET requests
This commit is contained in:
parent
fa5c7afce2
commit
2822191271
2 changed files with 21 additions and 5 deletions
|
|
@ -307,11 +307,7 @@ class Security
|
|||
*/
|
||||
public static function checkCSRF($referer = null)
|
||||
{
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'GET')
|
||||
{
|
||||
return true;
|
||||
}
|
||||
elseif ($token = $_SERVER['HTTP_X_CSRF_TOKEN'])
|
||||
if ($token = $_SERVER['HTTP_X_CSRF_TOKEN'])
|
||||
{
|
||||
return Session::verifyToken($token);
|
||||
}
|
||||
|
|
@ -319,6 +315,10 @@ class Security
|
|||
{
|
||||
return Session::verifyToken($token);
|
||||
}
|
||||
elseif ($_SERVER['REQUEST_METHOD'] === 'GET')
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Session::getMemberSrl())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue