Request::getValues() doesn't parse json request anymore

This commit is contained in:
Frédéric Guillot 2014-09-28 09:33:53 -04:00
parent 9003f830ef
commit 0c8de6a3f5
1 changed files with 3 additions and 14 deletions

View File

@ -50,26 +50,15 @@ class Request
}
/**
* Get form values or unserialized json request
* Get form values and check for CSRF token
*
* @access public
* @return array
*/
public function getValues()
{
if (! empty($_POST)) {
if (Security::validateCSRFFormToken($_POST)) {
return $_POST;
}
return array();
}
$result = json_decode($this->getBody(), true);
if ($result) {
return $result;
if (! empty($_POST) && Security::validateCSRFFormToken($_POST)) {
return $_POST;
}
return array();