Merge branch 'PHP-7.4'

* PHP-7.4:
  Fix #79174: cookie values with spaces fail to round-trip
This commit is contained in:
Christoph M. Becker 2020-01-28 15:37:51 +01:00
commit 0563dfee1b
2 changed files with 2 additions and 2 deletions

View File

@ -123,7 +123,7 @@ PHPAPI int php_setcookie(zend_string *name, zend_string *value, time_t expires,
smart_str_append(&buf, name);
smart_str_appendc(&buf, '=');
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);
zend_string_release_ex(encoded_value, 0);
} else {

View File

@ -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=value',
'Set-Cookie: name=space+value',
'Set-Cookie: name=space%20value',
'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', $tsn).' GMT; Max-Age=0',