Skip to content

Commit

Permalink
Remove trailing ;.
Browse files Browse the repository at this point in the history
This prevents empty keys from sneaking into the parsed data.
  • Loading branch information
markstory committed Jan 14, 2013
1 parent cc8153e commit 30c4c54
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/Cake/Network/Http/Response.php
Expand Up @@ -136,6 +136,7 @@ protected function _parseHeaders($headers) {
* @return void
*/
protected function _parseCookie($value) {
$value = rtrim($value, ';');
$nestedSemi = '";"';
if (strpos($value, $nestedSemi) !== false) {
$value = str_replace($nestedSemi, "{__cookie_replace__}", $value);
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Test/TestCase/Network/Http/ResponseTest.php
Expand Up @@ -153,7 +153,7 @@ public function testCookie() {
'HTTP/1.0 200 Ok',
'Set-Cookie: test=value',
'Set-Cookie: session=123abc',
'Set-Cookie: expiring=soon; Expires=Wed, 09-Jun-2021 10:18:14 GMT; Path=/; HttpOnly; Secure',
'Set-Cookie: expiring=soon; Expires=Wed, 09-Jun-2021 10:18:14 GMT; Path=/; HttpOnly; Secure;',
];
$response = new Response($headers, '');
$this->assertEquals('value', $response->cookie('test'));
Expand Down

0 comments on commit 30c4c54

Please sign in to comment.