mirror of
https://github.com/php/php-src.git
synced 2024-12-19 15:00:15 +08:00
Merge branch 'PHP-7.4'
* PHP-7.4: Fix #79174: cookie values with spaces fail to round-trip
This commit is contained in:
commit
0563dfee1b
@ -123,7 +123,7 @@ PHPAPI int php_setcookie(zend_string *name, zend_string *value, time_t expires,
|
|||||||
smart_str_append(&buf, name);
|
smart_str_append(&buf, name);
|
||||||
smart_str_appendc(&buf, '=');
|
smart_str_appendc(&buf, '=');
|
||||||
if (url_encode) {
|
if (url_encode) {
|
||||||
zend_string *encoded_value = php_url_encode(ZSTR_VAL(value), ZSTR_LEN(value));
|
zend_string *encoded_value = php_raw_url_encode(ZSTR_VAL(value), ZSTR_LEN(value));
|
||||||
smart_str_append(&buf, encoded_value);
|
smart_str_append(&buf, encoded_value);
|
||||||
zend_string_release_ex(encoded_value, 0);
|
zend_string_release_ex(encoded_value, 0);
|
||||||
} else {
|
} else {
|
||||||
|
@ -24,7 +24,7 @@ $expected = array(
|
|||||||
'Set-Cookie: name=deleted; expires='.date('D, d-M-Y H:i:s', 1).' GMT; Max-Age=0',
|
'Set-Cookie: name=deleted; expires='.date('D, d-M-Y H:i:s', 1).' GMT; Max-Age=0',
|
||||||
'Set-Cookie: name=deleted; expires='.date('D, d-M-Y H:i:s', 1).' GMT; Max-Age=0',
|
'Set-Cookie: name=deleted; expires='.date('D, d-M-Y H:i:s', 1).' GMT; Max-Age=0',
|
||||||
'Set-Cookie: name=value',
|
'Set-Cookie: name=value',
|
||||||
'Set-Cookie: name=space+value',
|
'Set-Cookie: name=space%20value',
|
||||||
'Set-Cookie: name=value',
|
'Set-Cookie: name=value',
|
||||||
'Set-Cookie: name=value; expires='.date('D, d-M-Y H:i:s', $tsp).' GMT; Max-Age=5',
|
'Set-Cookie: name=value; expires='.date('D, d-M-Y H:i:s', $tsp).' GMT; Max-Age=5',
|
||||||
'Set-Cookie: name=value; expires='.date('D, d-M-Y H:i:s', $tsn).' GMT; Max-Age=0',
|
'Set-Cookie: name=value; expires='.date('D, d-M-Y H:i:s', $tsn).' GMT; Max-Age=0',
|
||||||
|
Loading…
Reference in New Issue
Block a user