Skip to content

Commit 1441f30

Browse files
committed
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1: Remove session ID set through REQUEST_URI
2 parents 34a1a1b + f160eff commit 1441f30

File tree

2 files changed

+4
-16
lines changed

2 files changed

+4
-16
lines changed

NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ PHP NEWS
55
- PCRE:
66
. Mangle PCRE regex cache key with JIT option. (mvorisek)
77

8+
- Session:
9+
. Removed broken url support for transferring session ID. (ilutov)
10+
811
06 Jul 2023, PHP 8.2.8
912

1013
- CLI:

ext/session/session.c

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1489,7 +1489,7 @@ PHPAPI zend_result php_session_start(void) /* {{{ */
14891489
{
14901490
zval *ppid;
14911491
zval *data;
1492-
char *p, *value;
1492+
char *value;
14931493
size_t lensess;
14941494

14951495
switch (PS(session_status)) {
@@ -1558,21 +1558,6 @@ PHPAPI zend_result php_session_start(void) /* {{{ */
15581558
ppid2sid(ppid);
15591559
}
15601560
}
1561-
/* Check the REQUEST_URI symbol for a string of the form
1562-
* '<session-name>=<session-id>' to allow URLs of the form
1563-
* http://yoursite/<session-name>=<session-id>/script.php */
1564-
if (!PS(id) && zend_is_auto_global(ZSTR_KNOWN(ZEND_STR_AUTOGLOBAL_SERVER)) == SUCCESS &&
1565-
(data = zend_hash_str_find(Z_ARRVAL(PG(http_globals)[TRACK_VARS_SERVER]), "REQUEST_URI", sizeof("REQUEST_URI") - 1)) &&
1566-
Z_TYPE_P(data) == IS_STRING &&
1567-
(p = strstr(Z_STRVAL_P(data), PS(session_name))) &&
1568-
p[lensess] == '='
1569-
) {
1570-
char *q;
1571-
p += lensess + 1;
1572-
if ((q = strpbrk(p, "/?\\"))) {
1573-
PS(id) = zend_string_init(p, q - p, 0);
1574-
}
1575-
}
15761561
/* Check whether the current request was referred to by
15771562
* an external site which invalidates the previously found id. */
15781563
if (PS(id) && PS(extern_referer_chk)[0] != '\0' &&

0 commit comments

Comments
 (0)