1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Fix RC violation of session SID constant deprecation attribute

Don't use persistent string/attribute for the global SID constant, which is
created at runtime and destroyed at the end of the request.

Requires CFLAGS="-DZEND_RC_DEBUG=1" to reproduce.

Closes GH-19595
This commit is contained in:
Ilija Tovilo
2025-08-26 13:34:49 +02:00
parent ae1438b5e5
commit b7d66189cb
2 changed files with 4 additions and 2 deletions

2
NEWS
View File

@@ -2,6 +2,8 @@ PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? ????, PHP 8.5.0beta3
- Session:
. Fix RC violation of session SID constant deprecation attribute. (ilutov)
28 Aug 2025, PHP 8.5.0beta2

View File

@@ -1529,8 +1529,8 @@ PHPAPI zend_result php_session_reset_id(void)
}
}
if (new_sid_constant != NULL) {
zend_string *deprecation_reason = zend_string_init("as GET/POST sessions were deprecated", strlen("as GET/POST sessions were deprecated"), 1);
zend_attribute *deprecation_attrib = zend_add_global_constant_attribute(new_sid_constant, ZSTR_KNOWN(ZEND_STR_DEPRECATED_CAPITALIZED), 2);
zend_string *deprecation_reason = zend_string_init("as GET/POST sessions were deprecated", strlen("as GET/POST sessions were deprecated"), 0);
zend_attribute *deprecation_attrib = zend_add_attribute(&new_sid_constant->attributes, ZSTR_KNOWN(ZEND_STR_DEPRECATED_CAPITALIZED), 2, 0, 0, 0);
ZVAL_STR(&deprecation_attrib->args[0].value, ZSTR_KNOWN(ZEND_STR_8_DOT_4));
deprecation_attrib->args[0].name = ZSTR_KNOWN(ZEND_STR_SINCE);
ZVAL_STR(&deprecation_attrib->args[1].value, deprecation_reason);