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

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 * @access public
* @return array * @return array
*/ */
public function getValues() public function getValues()
{ {
if (! empty($_POST)) { if (! empty($_POST) && Security::validateCSRFFormToken($_POST)) {
return $_POST;
if (Security::validateCSRFFormToken($_POST)) {
return $_POST;
}
return array();
}
$result = json_decode($this->getBody(), true);
if ($result) {
return $result;
} }
return array(); return array();