Skip to content

Commit

Permalink
Merge branch 'master' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
nateabele committed Nov 14, 2013
2 parents c430137 + 6aee667 commit b5e621b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion data/Entity.php
Expand Up @@ -177,7 +177,7 @@ public function &__get($name) {
* @param string $value Property value.
* @return mixed Result.
*/
public function __set($name, $value = null) {
public function __set($name, $value) {
if (is_array($name) && !$value) {
return array_map(array(&$this, '__set'), array_keys($name), array_values($name));
}
Expand Down
2 changes: 1 addition & 1 deletion net/http/Response.php
Expand Up @@ -406,7 +406,7 @@ protected function _httpChunkedDecode($body) {
if (stripos($this->headers('Transfer-Encoding'), 'chunked') === false) {
return $body;
}
$stream = fopen('data://text/plain,' . $body, 'r');
$stream = fopen('data://text/plain;base64,' . base64_encode($body), 'r');
stream_filter_append($stream, 'dechunk');
return trim(stream_get_contents($stream));
}
Expand Down
11 changes: 11 additions & 0 deletions tests/cases/net/http/ResponseTest.php
Expand Up @@ -390,6 +390,17 @@ public function testTransferEncodingChunkedDecode() {
$response = new Response(compact('message'));
$result = $response->body();
$this->assertEqual($expected, $result);

$expected = '1+1 is 2, 10%40 is 20.';
$message = $headers . join("\r\n", array(
'22',
$expected,
'',
));

$response = new Response(compact('message'));
$result = $response->body();
$this->assertEqual($expected, $result);
}

public function testTypePriority() {
Expand Down

0 comments on commit b5e621b

Please sign in to comment.