File tree 3 files changed +22
-4
lines changed
3 files changed +22
-4
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,10 @@ PHP NEWS
28
28
- PHPDBG:
29
29
. Fixed bug GH-16174 (Empty string is an invalid expression for ev). (cmb)
30
30
31
+ - Session:
32
+ . Fixed bug GH-16385 (Unexpected null returned by session_set_cookie_params).
33
+ (nielsdos)
34
+
31
35
- XMLReader:
32
36
. Fixed bug GH-16292 (Segmentation fault in ext/xmlreader/php_xmlreader.c).
33
37
(nielsdos)
Original file line number Diff line number Diff line change @@ -1690,10 +1690,6 @@ PHP_FUNCTION(session_set_cookie_params)
1690
1690
zend_result result ;
1691
1691
int found = 0 ;
1692
1692
1693
- if (!PS (use_cookies )) {
1694
- return ;
1695
- }
1696
-
1697
1693
ZEND_PARSE_PARAMETERS_START (1 , 5 )
1698
1694
Z_PARAM_ARRAY_HT_OR_LONG (options_ht , lifetime_long )
1699
1695
Z_PARAM_OPTIONAL
@@ -1703,6 +1699,11 @@ PHP_FUNCTION(session_set_cookie_params)
1703
1699
Z_PARAM_BOOL_OR_NULL (httponly , httponly_null )
1704
1700
ZEND_PARSE_PARAMETERS_END ();
1705
1701
1702
+ if (!PS (use_cookies )) {
1703
+ php_error_docref (NULL , E_WARNING , "Session cookies cannot be used when session.use_cookies is disabled" );
1704
+ RETURN_FALSE ;
1705
+ }
1706
+
1706
1707
if (PS (session_status ) == php_session_active ) {
1707
1708
php_error_docref (NULL , E_WARNING , "Session cookie parameters cannot be changed when a session is active" );
1708
1709
RETURN_FALSE ;
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ GH-16385 (Unexpected null returned by session_set_cookie_params)
3
+ --EXTENSIONS--
4
+ session
5
+ --INI--
6
+ session.use_cookies=0
7
+ --FILE--
8
+ <?php
9
+ var_dump (session_set_cookie_params (3600 , "/foo " ));
10
+ ?>
11
+ --EXPECTF--
12
+ Warning: session_set_cookie_params(): Session cookies cannot be used when session.use_cookies is disabled in %s on line %d
13
+ bool(false)
You can’t perform that action at this time.
0 commit comments