Make CakeRequest work with content-type headers that include a charset.

Refs #3113
This commit is contained in:
mark_story 2012-08-14 12:40:33 -04:00
parent 65e63c51c8
commit e183e91b17
2 changed files with 2 additions and 2 deletions

View file

@ -165,7 +165,7 @@ class CakeRequest implements ArrayAccess {
$this->data = $_POST;
} elseif ($this->is('put') || $this->is('delete')) {
$this->data = $this->_readInput();
if (env('CONTENT_TYPE') === 'application/x-www-form-urlencoded') {
if (strpos(env('CONTENT_TYPE'), 'application/x-www-form-urlencoded') === 0) {
parse_str($this->data, $this->data);
}
}

View file

@ -233,7 +233,7 @@ class CakeRequestTest extends CakeTestCase {
*/
public function testPutParsing() {
$_SERVER['REQUEST_METHOD'] = 'PUT';
$_SERVER['CONTENT_TYPE'] = 'application/x-www-form-urlencoded';
$_SERVER['CONTENT_TYPE'] = 'application/x-www-form-urlencoded; charset=UTF-8';
$data = array('data' => array(
'Article' => array('title')