File tree Expand file tree Collapse file tree 3 files changed +22
-4
lines changed Expand file tree Collapse file tree 3 files changed +22
-4
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,10 @@ PHP NEWS
30
30
- PHPDBG:
31
31
. Fixed bug GH-16174 (Empty string is an invalid expression for ev). (cmb)
32
32
33
+ - Session:
34
+ . Fixed bug GH-16385 (Unexpected null returned by session_set_cookie_params).
35
+ (nielsdos)
36
+
33
37
- XMLReader:
34
38
. Fixed bug GH-16292 (Segmentation fault in ext/xmlreader/php_xmlreader.c).
35
39
(nielsdos)
Original file line number Diff line number Diff line change @@ -1772,10 +1772,6 @@ PHP_FUNCTION(session_set_cookie_params)
1772
1772
zend_result result ;
1773
1773
int found = 0 ;
1774
1774
1775
- if (!PS (use_cookies )) {
1776
- return ;
1777
- }
1778
-
1779
1775
ZEND_PARSE_PARAMETERS_START (1 , 5 )
1780
1776
Z_PARAM_ARRAY_HT_OR_LONG (options_ht , lifetime_long )
1781
1777
Z_PARAM_OPTIONAL
@@ -1785,6 +1781,11 @@ PHP_FUNCTION(session_set_cookie_params)
1785
1781
Z_PARAM_BOOL_OR_NULL (httponly , httponly_null )
1786
1782
ZEND_PARSE_PARAMETERS_END ();
1787
1783
1784
+ if (!PS (use_cookies )) {
1785
+ php_error_docref (NULL , E_WARNING , "Session cookies cannot be used when session.use_cookies is disabled" );
1786
+ RETURN_FALSE ;
1787
+ }
1788
+
1788
1789
if (PS (session_status ) == php_session_active ) {
1789
1790
php_error_docref (NULL , E_WARNING , "Session cookie parameters cannot be changed when a session is active" );
1790
1791
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