Apply non-GET/non-POST CSRF patch from XE 1.8.24 (bed604e)

This commit is contained in:
Kijin Sung 2016-08-05 17:03:24 +09:00
parent 2978c1f9e4
commit e771e4ae0b

View file

@ -475,8 +475,8 @@ class ModuleHandler extends Handler
}
}
// check CSRF for POST actions
if(Context::getRequestMethod() === 'POST' && Context::isInstalled())
// check CSRF for non-GET (POST, PUT, etc.) actions
if(Context::getRequestMethod() !== 'GET' && Context::isInstalled())
{
if($xml_info->action->{$this->act} && $xml_info->action->{$this->act}->check_csrf !== 'false' && !checkCSRF())
{
@ -617,8 +617,8 @@ class ModuleHandler extends Handler
}
}
// check CSRF for POST actions
if(Context::getRequestMethod() === 'POST' && Context::isInstalled())
// check CSRF for non-GET (POST, PUT, etc.) actions
if(Context::getRequestMethod() !== 'GET' && Context::isInstalled())
{
if($xml_info->action->{$this->act} && $xml_info->action->{$this->act}->check_csrf !== 'false' && !checkCSRF())
{