Commit 495c4947c67 for php.net
commit 495c4947c67f30824cc0e53ddc949dc381d0375b
Merge: e039ee92313 4868dd4e020
Author: Ilia Alshanetsky <ilia@ilia.ws>
Date: Tue Sep 22 20:41:53 2026 -0400
Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
ext/session: Abort strict-mode re-creation when create_sid() fails
diff --cc NEWS
index d6ca8e92c10,6235628cbb1..a8ff0d7580d
--- a/NEWS
+++ b/NEWS
@@@ -73,6 -68,14 +73,10 @@@ PH
. Fixed a heap over-read in the interactive shell prompt when cli.prompt is
set to an empty string. (Ilia Alshanetsky)
+ - Session:
+ . Fixed session_start() continuing after a failed create_sid() when
+ session.use_strict_mode rejects the supplied ID. (Ilia Alshanetsky)
+
-- Sockets:
- . Fixed socket_select() silently truncating sets larger than FD_SETSIZE on
- Windows. (David Carlier)
-
- SQLite:
. Fixed a crash when SQLite3::close() is called from a userland callback.
(Ilia Alshanetsky)
diff --cc ext/session/session.c
index 26df9c68f9b,bed25c2ebba..46806b9ff0b
--- a/ext/session/session.c
+++ b/ext/session/session.c
@@@ -477,7 -465,11 +477,11 @@@ static zend_result php_session_initiali
}
PS(id) = PS(mod)->s_create_sid(&PS(mod_data));
if (!PS(id)) {
- PS(id) = php_session_create_id(NULL);
+ php_session_abort();
+ if (!EG(exception)) {
- zend_throw_error(NULL, "Failed to create session ID: %s (path: %s)", PS(mod)->s_name, PS(save_path));
++ zend_throw_error(NULL, "Failed to create session ID: %s (path: %s)", PS(mod)->s_name, ZSTR_VAL(PS(save_path)));
+ }
+ return FAILURE;
}
if (PS(use_cookies)) {
PS(send_cookie) = 1;