diff options
author | Xinchen Hui <laruence@gmail.com> | 2018-08-17 13:45:43 +0800 |
---|---|---|
committer | Xinchen Hui <laruence@gmail.com> | 2018-08-17 13:45:43 +0800 |
commit | d61ff37f45de803ec45dd7f722bf4b51c3b0be02 (patch) | |
tree | 12566977143729825c449e0b4f8c759dacdc9e88 | |
parent | 2aa3733daa25838946b976ed567e2ba2d1700a42 (diff) | |
download | php-git-d61ff37f45de803ec45dd7f722bf4b51c3b0be02.tar.gz |
Fixed bug #76755 (setcookie does not accept "double" type for expire time)
-rw-r--r-- | NEWS | 4 | ||||
-rw-r--r-- | ext/standard/head.c | 2 | ||||
-rw-r--r-- | ext/standard/tests/network/bug76755.phpt | 8 |
3 files changed, 13 insertions, 1 deletions
@@ -12,6 +12,10 @@ PHP NEWS . Fixed bug #76747 (Opcache treats path containing "test.pharma.tld" as a phar file). (Laruence) +- Standard: + . Fixed bug #76755 (setcookie does not accept "double" type for expire time). + (Laruence) + 16 Aug 2018, PHP 7.3.0beta2 - Core: diff --git a/ext/standard/head.c b/ext/standard/head.c index 5e753840cc..2ba68aabcf 100644 --- a/ext/standard/head.c +++ b/ext/standard/head.c @@ -286,7 +286,7 @@ PHP_FUNCTION(setcookie) goto cleanup; } } else { - expires = Z_LVAL_P(expires_or_options); + expires = zval_get_long(expires_or_options); } } diff --git a/ext/standard/tests/network/bug76755.phpt b/ext/standard/tests/network/bug76755.phpt new file mode 100644 index 0000000000..361ae8a1a8 --- /dev/null +++ b/ext/standard/tests/network/bug76755.phpt @@ -0,0 +1,8 @@ +--TEST-- +Bug #76755 (setcookie does not accept "double" type for expire time) +--FILE-- +<?php +var_dump(setcookie('name', 'value', (real)(time() + 1296000))); +?> +--EXPECT-- +bool(true) |