Skip to content

Commit b7d6618

Browse files
committed
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
1 parent ae1438b commit b7d6618

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ PHP NEWS
22
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
33
?? ??? ????, PHP 8.5.0beta3
44

5+
- Session:
6+
. Fix RC violation of session SID constant deprecation attribute. (ilutov)
57

68
28 Aug 2025, PHP 8.5.0beta2
79

ext/session/session.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1529,8 +1529,8 @@ PHPAPI zend_result php_session_reset_id(void)
15291529
}
15301530
}
15311531
if (new_sid_constant != NULL) {
1532-
zend_string *deprecation_reason = zend_string_init("as GET/POST sessions were deprecated", strlen("as GET/POST sessions were deprecated"), 1);
1533-
zend_attribute *deprecation_attrib = zend_add_global_constant_attribute(new_sid_constant, ZSTR_KNOWN(ZEND_STR_DEPRECATED_CAPITALIZED), 2);
1532+
zend_string *deprecation_reason = zend_string_init("as GET/POST sessions were deprecated", strlen("as GET/POST sessions were deprecated"), 0);
1533+
zend_attribute *deprecation_attrib = zend_add_attribute(&new_sid_constant->attributes, ZSTR_KNOWN(ZEND_STR_DEPRECATED_CAPITALIZED), 2, 0, 0, 0);
15341534
ZVAL_STR(&deprecation_attrib->args[0].value, ZSTR_KNOWN(ZEND_STR_8_DOT_4));
15351535
deprecation_attrib->args[0].name = ZSTR_KNOWN(ZEND_STR_SINCE);
15361536
ZVAL_STR(&deprecation_attrib->args[1].value, deprecation_reason);

0 commit comments

Comments
 (0)