Skip to content
Browse files

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

Refs #3113
  • Loading branch information...
1 parent 65e63c5 commit e183e91b178995564c56c2379fa02b331c223705 @markstory markstory committed Aug 14, 2012
Showing with 2 additions and 2 deletions.
  1. +1 −1 lib/Cake/Network/CakeRequest.php
  2. +1 −1 lib/Cake/Test/Case/Network/CakeRequestTest.php
View
2 lib/Cake/Network/CakeRequest.php
@@ -165,7 +165,7 @@ protected function _processPost() {
$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
2 lib/Cake/Test/Case/Network/CakeRequestTest.php
@@ -233,7 +233,7 @@ public function testPostParsing() {
*/
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')

0 comments on commit e183e91

Please sign in to comment.
Something went wrong with that request. Please try again.