mirror of
https://github.com/php/php-src.git
synced 2025-08-15 13:38:49 +02:00
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3: Fix GH-16385: Unexpected null returned by session_set_cookie_params
This commit is contained in:
commit
45f7f87b75
3 changed files with 22 additions and 4 deletions
4
NEWS
4
NEWS
|
@ -30,6 +30,10 @@ PHP NEWS
|
||||||
- PHPDBG:
|
- PHPDBG:
|
||||||
. Fixed bug GH-16174 (Empty string is an invalid expression for ev). (cmb)
|
. Fixed bug GH-16174 (Empty string is an invalid expression for ev). (cmb)
|
||||||
|
|
||||||
|
- Session:
|
||||||
|
. Fixed bug GH-16385 (Unexpected null returned by session_set_cookie_params).
|
||||||
|
(nielsdos)
|
||||||
|
|
||||||
- XMLReader:
|
- XMLReader:
|
||||||
. Fixed bug GH-16292 (Segmentation fault in ext/xmlreader/php_xmlreader.c).
|
. Fixed bug GH-16292 (Segmentation fault in ext/xmlreader/php_xmlreader.c).
|
||||||
(nielsdos)
|
(nielsdos)
|
||||||
|
|
|
@ -1772,10 +1772,6 @@ PHP_FUNCTION(session_set_cookie_params)
|
||||||
zend_result result;
|
zend_result result;
|
||||||
int found = 0;
|
int found = 0;
|
||||||
|
|
||||||
if (!PS(use_cookies)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
ZEND_PARSE_PARAMETERS_START(1, 5)
|
ZEND_PARSE_PARAMETERS_START(1, 5)
|
||||||
Z_PARAM_ARRAY_HT_OR_LONG(options_ht, lifetime_long)
|
Z_PARAM_ARRAY_HT_OR_LONG(options_ht, lifetime_long)
|
||||||
Z_PARAM_OPTIONAL
|
Z_PARAM_OPTIONAL
|
||||||
|
@ -1785,6 +1781,11 @@ PHP_FUNCTION(session_set_cookie_params)
|
||||||
Z_PARAM_BOOL_OR_NULL(httponly, httponly_null)
|
Z_PARAM_BOOL_OR_NULL(httponly, httponly_null)
|
||||||
ZEND_PARSE_PARAMETERS_END();
|
ZEND_PARSE_PARAMETERS_END();
|
||||||
|
|
||||||
|
if (!PS(use_cookies)) {
|
||||||
|
php_error_docref(NULL, E_WARNING, "Session cookies cannot be used when session.use_cookies is disabled");
|
||||||
|
RETURN_FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
if (PS(session_status) == php_session_active) {
|
if (PS(session_status) == php_session_active) {
|
||||||
php_error_docref(NULL, E_WARNING, "Session cookie parameters cannot be changed when a session is active");
|
php_error_docref(NULL, E_WARNING, "Session cookie parameters cannot be changed when a session is active");
|
||||||
RETURN_FALSE;
|
RETURN_FALSE;
|
||||||
|
|
13
ext/session/tests/gh16385.phpt
Normal file
13
ext/session/tests/gh16385.phpt
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
--TEST--
|
||||||
|
GH-16385 (Unexpected null returned by session_set_cookie_params)
|
||||||
|
--EXTENSIONS--
|
||||||
|
session
|
||||||
|
--INI--
|
||||||
|
session.use_cookies=0
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
var_dump(session_set_cookie_params(3600, "/foo"));
|
||||||
|
?>
|
||||||
|
--EXPECTF--
|
||||||
|
Warning: session_set_cookie_params(): Session cookies cannot be used when session.use_cookies is disabled in %s on line %d
|
||||||
|
bool(false)
|
Loading…
Add table
Add a link
Reference in a new issue