Skip to content

Commit d61ff37

Browse files
committed
Fixed bug #76755 (setcookie does not accept "double" type for expire time)
1 parent 2aa3733 commit d61ff37

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

Diff for: NEWS

+4
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ PHP NEWS
1212
. Fixed bug #76747 (Opcache treats path containing "test.pharma.tld" as a phar
1313
file). (Laruence)
1414

15+
- Standard:
16+
. Fixed bug #76755 (setcookie does not accept "double" type for expire time).
17+
(Laruence)
18+
1519
16 Aug 2018, PHP 7.3.0beta2
1620

1721
- Core:

Diff for: ext/standard/head.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ PHP_FUNCTION(setcookie)
286286
goto cleanup;
287287
}
288288
} else {
289-
expires = Z_LVAL_P(expires_or_options);
289+
expires = zval_get_long(expires_or_options);
290290
}
291291
}
292292

Diff for: ext/standard/tests/network/bug76755.phpt

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
--TEST--
2+
Bug #76755 (setcookie does not accept "double" type for expire time)
3+
--FILE--
4+
<?php
5+
var_dump(setcookie('name', 'value', (real)(time() + 1296000)));
6+
?>
7+
--EXPECT--
8+
bool(true)

0 commit comments

Comments
 (0)