Skip to content

Commit c3f9b42

Browse files
committed
Rebase alignments
1 parent b510ab1 commit c3f9b42

File tree

3 files changed

+4
-32
lines changed

3 files changed

+4
-32
lines changed

ext/session/php_session.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,9 @@ typedef struct _php_ps_globals {
147147
zend_long cookie_lifetime;
148148
zend_string *cookie_path;
149149
zend_string *cookie_domain;
150+
zend_string *cookie_samesite;
150151
bool cookie_secure;
151152
bool cookie_httponly;
152-
zend_string *cookie_samesite;
153153
const ps_module *mod;
154154
const ps_module *default_mod;
155155
void *mod_data;
@@ -198,7 +198,7 @@ typedef struct _php_ps_globals {
198198
bool rfc1867_enabled; /* session.upload_progress.enabled */
199199
bool rfc1867_cleanup; /* session.upload_progress.cleanup */
200200

201-
bool use_strict_mode; /* whether or not PHP accepts unknown session ids */
201+
bool use_strict_mode; /* whether PHP accepts unknown session ids */
202202
bool lazy_write; /* omit session write when it is possible */
203203
bool in_save_handler; /* state if session is in save handler or not */
204204
bool set_handler; /* state if session module i setting handler or not */

ext/session/session.c

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -969,7 +969,7 @@ PHP_INI_BEGIN()
969969
STD_PHP_INI_BOOLEAN("session.use_cookies", "1", PHP_INI_ALL, OnUpdateSessionBool, use_cookies, php_ps_globals, ps_globals)
970970
STD_PHP_INI_BOOLEAN("session.use_only_cookies", "1", PHP_INI_ALL, OnUpdateUseOnlyCookies, use_only_cookies, php_ps_globals, ps_globals)
971971
STD_PHP_INI_BOOLEAN("session.use_strict_mode", "0", PHP_INI_ALL, OnUpdateSessionBool, use_strict_mode, php_ps_globals, ps_globals)
972-
STD_PHP_INI_ENTRY("session.referer_check", "", PHP_INI_ALL, OnUpdateSessionStr, extern_referer_chk, php_ps_globals, ps_globals)
972+
STD_PHP_INI_ENTRY("session.referer_check", "", PHP_INI_ALL, OnUpdateRefererCheck, extern_referer_chk, php_ps_globals, ps_globals)
973973
STD_PHP_INI_ENTRY("session.cache_limiter", "nocache", PHP_INI_ALL, OnUpdateSessionStr, cache_limiter, php_ps_globals, ps_globals)
974974
STD_PHP_INI_ENTRY("session.cache_expire", "180", PHP_INI_ALL, OnUpdateSessionLong, cache_expire, php_ps_globals, ps_globals)
975975
STD_PHP_INI_BOOLEAN("session.use_trans_sid", "0", PHP_INI_ALL, OnUpdateUseTransSid, use_trans_sid, php_ps_globals, ps_globals)
@@ -1652,7 +1652,7 @@ PHPAPI zend_result php_session_start(void) /* {{{ */
16521652
{
16531653
zval *ppid;
16541654
zval *data;
1655-
char *p, *value;
1655+
char *value;
16561656

16571657
switch (PS(session_status)) {
16581658
case php_session_active:
@@ -1718,21 +1718,6 @@ PHPAPI zend_result php_session_start(void) /* {{{ */
17181718
ppid2sid(ppid);
17191719
}
17201720
}
1721-
/* Check the REQUEST_URI symbol for a string of the form
1722-
* '<session-name>=<session-id>' to allow URLs of the form
1723-
* http://yoursite/<session-name>=<session-id>/script.php */
1724-
if (!PS(id) && zend_is_auto_global(ZSTR_KNOWN(ZEND_STR_AUTOGLOBAL_SERVER)) == SUCCESS &&
1725-
(data = zend_hash_str_find(Z_ARRVAL(PG(http_globals)[TRACK_VARS_SERVER]), "REQUEST_URI", sizeof("REQUEST_URI") - 1)) &&
1726-
Z_TYPE_P(data) == IS_STRING &&
1727-
(p = strstr(Z_STRVAL_P(data), ZSTR_VAL(PS(session_name)))) &&
1728-
p[ZSTR_LEN(PS(session_name))] == '='
1729-
) {
1730-
char *q;
1731-
p += ZSTR_LEN(PS(session_name));
1732-
if ((q = strpbrk(p, "/?\\"))) {
1733-
PS(id) = zend_string_init(p, q - p, 0);
1734-
}
1735-
}
17361721
/* Check whether the current request was referred to by
17371722
* an external site which invalidates the previously found id. */
17381723
if (PS(id) && PS(extern_referer_chk) && ZSTR_LEN(PS(extern_referer_chk)) != 0 &&

ext/session/tests/session_name_variation1.phpt

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,6 @@ ob_start();
1515

1616
echo "*** Testing session_name() : variation ***\n";
1717

18-
var_dump(session_name("\0"));
19-
var_dump(session_start());
20-
var_dump(session_name());
21-
var_dump(session_destroy());
22-
var_dump(session_name());
23-
2418
var_dump(session_name("15"));
2519
var_dump(session_start());
2620
var_dump(session_name());
@@ -51,13 +45,6 @@ ob_end_flush();
5145
--EXPECTF--
5246
*** Testing session_name() : variation ***
5347

54-
Warning: session_name(): session.name "" cannot contain NUL bytes in %s on line %d
55-
string(9) "PHPSESSID"
56-
bool(true)
57-
string(9) "PHPSESSID"
58-
bool(true)
59-
string(9) "PHPSESSID"
60-
6148
Warning: session_name(): session.name "15" cannot be numeric in %s on line %d
6249
string(9) "PHPSESSID"
6350
bool(true)

0 commit comments

Comments
 (0)