From d61ff37f45de803ec45dd7f722bf4b51c3b0be02 Mon Sep 17 00:00:00 2001 From: Xinchen Hui Date: Fri, 17 Aug 2018 13:45:43 +0800 Subject: [PATCH] Fixed bug #76755 (setcookie does not accept "double" type for expire time) --- NEWS | 4 ++++ ext/standard/head.c | 2 +- ext/standard/tests/network/bug76755.phpt | 8 ++++++++ 3 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 ext/standard/tests/network/bug76755.phpt diff --git a/NEWS b/NEWS index 940bebf2f0..66a302e516 100644 --- a/NEWS +++ b/NEWS @@ -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-- + +--EXPECT-- +bool(true) -- 2.49.0