From c5bce0d8a2e6794cd6809e4047dd1f488fa3459b Mon Sep 17 00:00:00 2001 From: Kamil Tekiela Date: Sat, 24 Aug 2024 16:33:45 +0200 Subject: [PATCH] Deprecate disabling use_only_cookies (#13578) --- ext/session/session.c | 44 +++++++++++-- ext/session/tests/015.phpt | 10 ++- ext/session/tests/018.phpt | 3 + ext/session/tests/020.phpt | 3 + ext/session/tests/021.phpt | 7 +- ext/session/tests/bug36459.phpt | 3 + ext/session/tests/bug41600.phpt | 3 + ext/session/tests/bug42596.phpt | 1 + ext/session/tests/bug50308.phpt | 3 + ext/session/tests/bug51338.phpt | 1 + ext/session/tests/bug71683.phpt | 1 + ext/session/tests/bug71974.phpt | 1 + ext/session/tests/bug72940.phpt | 9 ++- ext/session/tests/bug74892.phpt | 17 +++-- ext/session/tests/deprecations.phpt | 64 +++++++++++++++++++ ext/session/tests/gh13891.phpt | 11 +++- ext/session/tests/rfc1867.phpt | 1 + ext/session/tests/rfc1867_cleanup.phpt | 1 + ext/session/tests/rfc1867_disabled.phpt | 1 + ext/session/tests/rfc1867_disabled_2.phpt | 1 + ext/session/tests/rfc1867_inter.phpt | 1 + ext/session/tests/rfc1867_no_name.phpt | 1 + ext/session/tests/rfc1867_sid_cookie.phpt | 1 + ext/session/tests/rfc1867_sid_get.phpt | 1 + ext/session/tests/rfc1867_sid_get_2.phpt | 1 + ext/session/tests/rfc1867_sid_invalid.phpt | 1 - ext/session/tests/rfc1867_sid_post.phpt | 1 + ext/session/tests/session_basic3.phpt | 3 + ext/session/tests/session_basic4.phpt | 3 + ext/session/tests/session_basic5.phpt | 7 +- .../tests/general_functions/bug44394_2.phpt | 5 +- .../output_add_rewrite_var_basic1.phpt | 7 +- .../output_add_rewrite_var_basic2.phpt | 5 +- .../output_add_rewrite_var_basic3.phpt | 5 +- .../output_add_rewrite_var_basic4.phpt | 4 +- .../url_rewriting_basic1.phpt | 7 +- .../url_rewriting_basic2.phpt | 7 +- .../url_rewriting_basic3.phpt | 7 +- ext/standard/url_scanner_ex.re | 6 ++ 39 files changed, 233 insertions(+), 25 deletions(-) create mode 100644 ext/session/tests/deprecations.phpt diff --git a/ext/session/session.c b/ext/session/session.c index 6c954a93278..3d762886dbb 100644 --- a/ext/session/session.c +++ b/ext/session/session.c @@ -846,6 +846,40 @@ static PHP_INI_MH(OnUpdateRfc1867Freq) /* {{{ */ return SUCCESS; } /* }}} */ +static PHP_INI_MH(OnUpdateUseOnlyCookies) +{ + SESSION_CHECK_ACTIVE_STATE; + SESSION_CHECK_OUTPUT_STATE; + bool *p = (bool *) ZEND_INI_GET_ADDR(); + *p = zend_ini_parse_bool(new_value); + if (!*p) { + php_error_docref("session.configuration", E_DEPRECATED, "Disabling session.use_only_cookies INI setting is deprecated"); + } + return SUCCESS; +} + +static PHP_INI_MH(OnUpdateUseTransSid) +{ + SESSION_CHECK_ACTIVE_STATE; + SESSION_CHECK_OUTPUT_STATE; + bool *p = (bool *) ZEND_INI_GET_ADDR(); + *p = zend_ini_parse_bool(new_value); + if (*p) { + php_error_docref("session.configuration", E_DEPRECATED, "Enabling session.use_trans_sid INI setting is deprecated"); + } + return SUCCESS; +} + +static PHP_INI_MH(OnUpdateRefererCheck) +{ + SESSION_CHECK_ACTIVE_STATE; + SESSION_CHECK_OUTPUT_STATE; + if (ZSTR_LEN(new_value) != 0) { + php_error_docref("session.configuration", E_DEPRECATED, "Usage of session.referer_check INI setting is deprecated"); + } + return OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage); +} + /* {{{ PHP_INI */ PHP_INI_BEGIN() STD_PHP_INI_ENTRY("session.save_path", "", PHP_INI_ALL, OnUpdateSaveDir, save_path, php_ps_globals, ps_globals) @@ -863,12 +897,12 @@ PHP_INI_BEGIN() STD_PHP_INI_BOOLEAN("session.cookie_httponly", "0", PHP_INI_ALL, OnUpdateSessionBool, cookie_httponly, php_ps_globals, ps_globals) STD_PHP_INI_ENTRY("session.cookie_samesite", "", PHP_INI_ALL, OnUpdateSessionString, cookie_samesite, php_ps_globals, ps_globals) STD_PHP_INI_BOOLEAN("session.use_cookies", "1", PHP_INI_ALL, OnUpdateSessionBool, use_cookies, php_ps_globals, ps_globals) - STD_PHP_INI_BOOLEAN("session.use_only_cookies", "1", PHP_INI_ALL, OnUpdateSessionBool, use_only_cookies, php_ps_globals, ps_globals) + STD_PHP_INI_BOOLEAN("session.use_only_cookies", "1", PHP_INI_ALL, OnUpdateUseOnlyCookies, use_only_cookies, php_ps_globals, ps_globals) STD_PHP_INI_BOOLEAN("session.use_strict_mode", "0", PHP_INI_ALL, OnUpdateSessionBool, use_strict_mode, php_ps_globals, ps_globals) - STD_PHP_INI_ENTRY("session.referer_check", "", PHP_INI_ALL, OnUpdateSessionString, extern_referer_chk, php_ps_globals, ps_globals) + STD_PHP_INI_ENTRY("session.referer_check", "", PHP_INI_ALL, OnUpdateRefererCheck, extern_referer_chk, php_ps_globals, ps_globals) STD_PHP_INI_ENTRY("session.cache_limiter", "nocache", PHP_INI_ALL, OnUpdateSessionString, cache_limiter, php_ps_globals, ps_globals) STD_PHP_INI_ENTRY("session.cache_expire", "180", PHP_INI_ALL, OnUpdateSessionLong, cache_expire, php_ps_globals, ps_globals) - STD_PHP_INI_BOOLEAN("session.use_trans_sid", "0", PHP_INI_ALL, OnUpdateSessionBool, use_trans_sid, php_ps_globals, ps_globals) + STD_PHP_INI_BOOLEAN("session.use_trans_sid", "0", PHP_INI_ALL, OnUpdateUseTransSid, use_trans_sid, php_ps_globals, ps_globals) PHP_INI_ENTRY("session.sid_length", "32", PHP_INI_ALL, OnUpdateSidLength) PHP_INI_ENTRY("session.sid_bits_per_character", "4", PHP_INI_ALL, OnUpdateSidBits) STD_PHP_INI_BOOLEAN("session.lazy_write", "1", PHP_INI_ALL, OnUpdateSessionBool, lazy_write, php_ps_globals, ps_globals) @@ -1516,7 +1550,7 @@ PHPAPI zend_result php_session_reset_id(void) /* {{{ */ zval_ptr_dtor_str(sid); ZVAL_STR(sid, smart_str_extract(&var)); } else { - REGISTER_STRINGL_CONSTANT("SID", ZSTR_VAL(var.s), ZSTR_LEN(var.s), 0); + REGISTER_STRINGL_CONSTANT("SID", ZSTR_VAL(var.s), ZSTR_LEN(var.s), CONST_DEPRECATED); smart_str_free(&var); } } else { @@ -1524,7 +1558,7 @@ PHPAPI zend_result php_session_reset_id(void) /* {{{ */ zval_ptr_dtor_str(sid); ZVAL_EMPTY_STRING(sid); } else { - REGISTER_STRINGL_CONSTANT("SID", "", 0, 0); + REGISTER_STRINGL_CONSTANT("SID", "", 0, CONST_DEPRECATED); } } diff --git a/ext/session/tests/015.phpt b/ext/session/tests/015.phpt index 1d6e9d65fe6..3154022fae8 100644 --- a/ext/session/tests/015.phpt +++ b/ext/session/tests/015.phpt @@ -20,10 +20,16 @@ error_reporting(E_ALL); session_id("test015"); session_start(); +$sid = SID; ?> - + ---EXPECT-- +--EXPECTF-- +Deprecated: PHP Startup: Disabling session.use_only_cookies INI setting is deprecated in Unknown on line 0 + +Deprecated: PHP Startup: Enabling session.use_trans_sid INI setting is deprecated in Unknown on line 0 + +Deprecated: Constant SID is deprecated in %s on line 6 diff --git a/ext/session/tests/018.phpt b/ext/session/tests/018.phpt index f504f120d6b..5d9c6eb6261 100644 --- a/ext/session/tests/018.phpt +++ b/ext/session/tests/018.phpt @@ -26,4 +26,7 @@ session_start(); session_destroy(); ?> --EXPECT-- +Deprecated: PHP Startup: Disabling session.use_only_cookies INI setting is deprecated in Unknown on line 0 + +Deprecated: PHP Startup: Enabling session.use_trans_sid INI setting is deprecated in Unknown on line 0
diff --git a/ext/session/tests/020.phpt b/ext/session/tests/020.phpt index 873973f04bf..3fb64dbc076 100644 --- a/ext/session/tests/020.phpt +++ b/ext/session/tests/020.phpt @@ -27,4 +27,7 @@ session_start(); session_destroy(); ?> --EXPECT-- +Deprecated: PHP Startup: Disabling session.use_only_cookies INI setting is deprecated in Unknown on line 0 + +Deprecated: PHP Startup: Enabling session.use_trans_sid INI setting is deprecated in Unknown on line 0 diff --git a/ext/session/tests/021.phpt b/ext/session/tests/021.phpt index 02f712a9d87..00d5779adf4 100644 --- a/ext/session/tests/021.phpt +++ b/ext/session/tests/021.phpt @@ -59,7 +59,12 @@ ini_set("url_rewriter.tags", "a=href,fieldset=,area=href,frame=src,input=src"); session_destroy(); ?> ---EXPECT-- +--EXPECTF-- +Deprecated: PHP Startup: Disabling session.use_only_cookies INI setting is deprecated in Unknown on line 0 + +Deprecated: PHP Startup: Enabling session.use_trans_sid INI setting is deprecated in Unknown on line 0 + +Deprecated: ini_set(): Usage of session.trans_sid_hosts INI setting is deprecated in %s on line 4
diff --git a/ext/session/tests/bug36459.phpt b/ext/session/tests/bug36459.phpt index 201aed60e05..21a5f62c643 100644 --- a/ext/session/tests/bug36459.phpt +++ b/ext/session/tests/bug36459.phpt @@ -30,6 +30,9 @@ session_start(); --EXPECTF-- +Deprecated: PHP Startup: Disabling session.use_only_cookies INI setting is deprecated in Unknown on line 0 + +Deprecated: PHP Startup: Enabling session.use_trans_sid INI setting is deprecated in Unknown on line 0 Bug #36459 Incorrect adding PHPSESSID to links, which contains \r\n diff --git a/ext/session/tests/bug41600.phpt b/ext/session/tests/bug41600.phpt index 4181becfef3..09e89e67ea1 100644 --- a/ext/session/tests/bug41600.phpt +++ b/ext/session/tests/bug41600.phpt @@ -27,4 +27,7 @@ session_start(); session_destroy(); ?> --EXPECT-- +Deprecated: PHP Startup: Disabling session.use_only_cookies INI setting is deprecated in Unknown on line 0 + +Deprecated: PHP Startup: Enabling session.use_trans_sid INI setting is deprecated in Unknown on line 0 diff --git a/ext/session/tests/bug42596.phpt b/ext/session/tests/bug42596.phpt index dca5fc0c990..c1217384ce8 100644 --- a/ext/session/tests/bug42596.phpt +++ b/ext/session/tests/bug42596.phpt @@ -34,5 +34,6 @@ foreach (glob($sessdir. "*") as $sessfile) { rmdir($sessdir); ?> --EXPECT-- +Deprecated: PHP Startup: Enabling session.use_trans_sid INI setting is deprecated in Unknown on line 0 hello world string(6) "100777" diff --git a/ext/session/tests/bug50308.phpt b/ext/session/tests/bug50308.phpt index 414a8354d35..920f967d42f 100644 --- a/ext/session/tests/bug50308.phpt +++ b/ext/session/tests/bug50308.phpt @@ -25,6 +25,9 @@ session.use_only_cookies=0 --EXPECTF-- +Deprecated: PHP Startup: Disabling session.use_only_cookies INI setting is deprecated in Unknown on line 0 + +Deprecated: PHP Startup: Enabling session.use_trans_sid INI setting is deprecated in Unknown on line 0 diff --git a/ext/session/tests/bug51338.phpt b/ext/session/tests/bug51338.phpt index d6a2ddb6527..44d6cface05 100644 --- a/ext/session/tests/bug51338.phpt +++ b/ext/session/tests/bug51338.phpt @@ -13,6 +13,7 @@ session_start(); print_r(ob_list_handlers()); ?> --EXPECT-- +Deprecated: PHP Startup: Enabling session.use_trans_sid INI setting is deprecated in Unknown on line 0 Array ( ) diff --git a/ext/session/tests/bug71683.phpt b/ext/session/tests/bug71683.phpt index 9541121daa3..ad4783ee50c 100644 --- a/ext/session/tests/bug71683.phpt +++ b/ext/session/tests/bug71683.phpt @@ -14,4 +14,5 @@ ob_start(); echo "ok\n"; ?> --EXPECT-- +Deprecated: PHP Startup: Disabling session.use_only_cookies INI setting is deprecated in Unknown on line 0 ok diff --git a/ext/session/tests/bug71974.phpt b/ext/session/tests/bug71974.phpt index 1c16ab1c24e..225a465f4c5 100644 --- a/ext/session/tests/bug71974.phpt +++ b/ext/session/tests/bug71974.phpt @@ -5,6 +5,7 @@ session --SKIPIF-- --INI-- +display_startup_errors=0 session.save_handler=files session.auto_start=0 session.use_cookies=1 diff --git a/ext/session/tests/bug72940.phpt b/ext/session/tests/bug72940.phpt index 740c5410743..9a927a5419e 100644 --- a/ext/session/tests/bug72940.phpt +++ b/ext/session/tests/bug72940.phpt @@ -31,8 +31,15 @@ session_start(); var_dump(session_id(), SID); session_destroy(); ?> ---EXPECT-- +--EXPECTF-- +Deprecated: ini_set(): Disabling session.use_only_cookies INI setting is deprecated in %s on line 6 + +Deprecated: Constant SID is deprecated in %s on line 8 string(12) "bug72940test" string(0) "" + +Deprecated: ini_set(): Disabling session.use_only_cookies INI setting is deprecated in %s on line 13 + +Deprecated: Constant SID is deprecated in %s on line 15 string(11) "bug72940get" string(21) "PHPSESSID=bug72940get" diff --git a/ext/session/tests/bug74892.phpt b/ext/session/tests/bug74892.phpt index 793e67cfadd..916120cb4d4 100644 --- a/ext/session/tests/bug74892.phpt +++ b/ext/session/tests/bug74892.phpt @@ -1,15 +1,17 @@ --TEST-- Bug #74892 Url Rewriting (trans_sid) not working on urls that start with # +--INI-- +session.use_cookies=0 +session.use_only_cookies=0 +session.use_trans_sid=1 --EXTENSIONS-- session --SKIPIF-- --FILE-- External link with anchor

External link with anchor 2

Internal link

---EXPECT-- +--EXPECTF-- +Deprecated: PHP Startup: Disabling session.use_only_cookies INI setting is deprecated in Unknown on line 0 + +Deprecated: PHP Startup: Enabling session.use_trans_sid INI setting is deprecated in Unknown on line 0 + +Deprecated: ini_set(): Usage of session.trans_sid_hosts INI setting is deprecated in %s on line 3

Click This Anchor Tag!

External link with anchor

External link with anchor 2

diff --git a/ext/session/tests/deprecations.phpt b/ext/session/tests/deprecations.phpt new file mode 100644 index 00000000000..4a2337fb99d --- /dev/null +++ b/ext/session/tests/deprecations.phpt @@ -0,0 +1,64 @@ +--TEST-- +Deprecated GET/POST sessions +--EXTENSIONS-- +session +--SKIPIF-- + +--INI-- +session.use_cookies=0 +session.use_only_cookies=1 +session.use_trans_sid=0 +--FILE-- + '0', 'use_only_cookies' => '0', 'use_trans_sid' => '1']); + +echo SID; + +?> +--EXPECTF-- +Deprecated: ini_set(): Disabling session.use_only_cookies INI setting is deprecated in %s on line 6 + +Deprecated: ini_set(): Enabling session.use_trans_sid INI setting is deprecated in %s on line 11 + +Deprecated: ini_set(): Usage of session.trans_sid_tags INI setting is deprecated in %s on line 16 + +Deprecated: ini_set(): Usage of session.trans_sid_hosts INI setting is deprecated in %s on line 21 + +Deprecated: ini_set(): Usage of session.referer_check INI setting is deprecated in %s on line 26 + +Deprecated: session_start(): Disabling session.use_only_cookies INI setting is deprecated in %s on line 32 + +Deprecated: session_start(): Enabling session.use_trans_sid INI setting is deprecated in %s on line 32 + +Deprecated: Constant SID is deprecated in %s on line 34 +PHPSESSID=%s diff --git a/ext/session/tests/gh13891.phpt b/ext/session/tests/gh13891.phpt index 7df9bffa770..97c0bfd617b 100644 --- a/ext/session/tests/gh13891.phpt +++ b/ext/session/tests/gh13891.phpt @@ -14,4 +14,13 @@ session // We *must* set it here because the bug only triggers on a runtime edit ini_set('session.trans_sid_hosts','php.net'); ?> ---EXPECT-- +--EXPECTF-- +Deprecated: PHP Startup: Disabling session.use_only_cookies INI setting is deprecated in Unknown on line 0 + +Deprecated: PHP Startup: Enabling session.use_trans_sid INI setting is deprecated in Unknown on line 0 + +Deprecated: PHP Startup: Usage of session.trans_sid_hosts INI setting is deprecated in Unknown on line 0 + +Deprecated: ini_set(): Usage of session.trans_sid_hosts INI setting is deprecated in %s on line 3 + +Deprecated: PHP Request Shutdown: Usage of session.trans_sid_hosts INI setting is deprecated in Unknown on line 0 diff --git a/ext/session/tests/rfc1867.phpt b/ext/session/tests/rfc1867.phpt index 0962a91bc4f..6e2cf227529 100644 --- a/ext/session/tests/rfc1867.phpt +++ b/ext/session/tests/rfc1867.phpt @@ -1,6 +1,7 @@ --TEST-- session rfc1867 --INI-- +display_startup_errors=0 file_uploads=1 upload_max_filesize=1024 session.save_path= diff --git a/ext/session/tests/rfc1867_cleanup.phpt b/ext/session/tests/rfc1867_cleanup.phpt index cdfd3c83310..2cb25e8d692 100644 --- a/ext/session/tests/rfc1867_cleanup.phpt +++ b/ext/session/tests/rfc1867_cleanup.phpt @@ -1,6 +1,7 @@ --TEST-- session rfc1867 --INI-- +display_startup_errors=0 file_uploads=1 upload_max_filesize=1024 session.save_path= diff --git a/ext/session/tests/rfc1867_disabled.phpt b/ext/session/tests/rfc1867_disabled.phpt index a928a6171c3..4ca2048f044 100644 --- a/ext/session/tests/rfc1867_disabled.phpt +++ b/ext/session/tests/rfc1867_disabled.phpt @@ -1,6 +1,7 @@ --TEST-- session rfc1867 disabled --INI-- +display_startup_errors=0 file_uploads=1 upload_max_filesize=1024 session.save_path= diff --git a/ext/session/tests/rfc1867_disabled_2.phpt b/ext/session/tests/rfc1867_disabled_2.phpt index dcfbe075cbf..eb45d7f4bbc 100644 --- a/ext/session/tests/rfc1867_disabled_2.phpt +++ b/ext/session/tests/rfc1867_disabled_2.phpt @@ -1,6 +1,7 @@ --TEST-- session rfc1867 disabled 2 --INI-- +display_startup_errors=0 file_uploads=1 upload_max_filesize=1024 session.save_path= diff --git a/ext/session/tests/rfc1867_inter.phpt b/ext/session/tests/rfc1867_inter.phpt index a7ddff14f5e..5ab9983ea14 100644 --- a/ext/session/tests/rfc1867_inter.phpt +++ b/ext/session/tests/rfc1867_inter.phpt @@ -1,6 +1,7 @@ --TEST-- session rfc1867 --INI-- +display_startup_errors=0 file_uploads=1 upload_max_filesize=1024 session.save_path= diff --git a/ext/session/tests/rfc1867_no_name.phpt b/ext/session/tests/rfc1867_no_name.phpt index d6a771baf21..693c3814ec0 100644 --- a/ext/session/tests/rfc1867_no_name.phpt +++ b/ext/session/tests/rfc1867_no_name.phpt @@ -1,6 +1,7 @@ --TEST-- session rfc1867 no name --INI-- +display_startup_errors=0 file_uploads=1 upload_max_filesize=1024 session.save_path= diff --git a/ext/session/tests/rfc1867_sid_cookie.phpt b/ext/session/tests/rfc1867_sid_cookie.phpt index e090ebec5d6..5dc6492050f 100644 --- a/ext/session/tests/rfc1867_sid_cookie.phpt +++ b/ext/session/tests/rfc1867_sid_cookie.phpt @@ -1,6 +1,7 @@ --TEST-- session rfc1867 sid cookie --INI-- +display_startup_errors=0 file_uploads=1 upload_max_filesize=1024 session.save_path= diff --git a/ext/session/tests/rfc1867_sid_get.phpt b/ext/session/tests/rfc1867_sid_get.phpt index f227dd7d343..8929556cdb0 100644 --- a/ext/session/tests/rfc1867_sid_get.phpt +++ b/ext/session/tests/rfc1867_sid_get.phpt @@ -1,6 +1,7 @@ --TEST-- session rfc1867 sid get --INI-- +display_startup_errors=0 file_uploads=1 upload_max_filesize=1024 session.save_path= diff --git a/ext/session/tests/rfc1867_sid_get_2.phpt b/ext/session/tests/rfc1867_sid_get_2.phpt index 8362f3b58d4..1a771935c4a 100644 --- a/ext/session/tests/rfc1867_sid_get_2.phpt +++ b/ext/session/tests/rfc1867_sid_get_2.phpt @@ -1,6 +1,7 @@ --TEST-- session rfc1867 sid get 2 --INI-- +display_startup_errors=0 file_uploads=1 upload_max_filesize=1024 session.save_path= diff --git a/ext/session/tests/rfc1867_sid_invalid.phpt b/ext/session/tests/rfc1867_sid_invalid.phpt index fe01b5a8ba2..2a61ab98d92 100644 --- a/ext/session/tests/rfc1867_sid_invalid.phpt +++ b/ext/session/tests/rfc1867_sid_invalid.phpt @@ -6,7 +6,6 @@ upload_max_filesize=1024 session.save_path= session.name=PHPSESSID session.use_cookies=1 -session.use_only_cookies=0 session.use_strict_mode=0 session.auto_start=0 session.upload_progress.enabled=1 diff --git a/ext/session/tests/rfc1867_sid_post.phpt b/ext/session/tests/rfc1867_sid_post.phpt index e1f2123b56a..62bc17bd838 100644 --- a/ext/session/tests/rfc1867_sid_post.phpt +++ b/ext/session/tests/rfc1867_sid_post.phpt @@ -1,6 +1,7 @@ --TEST-- session rfc1867 sid post --INI-- +display_startup_errors=0 file_uploads=1 upload_max_filesize=1024 session.save_path= diff --git a/ext/session/tests/session_basic3.phpt b/ext/session/tests/session_basic3.phpt index 661f48546d1..7ddeffaa48d 100644 --- a/ext/session/tests/session_basic3.phpt +++ b/ext/session/tests/session_basic3.phpt @@ -222,6 +222,9 @@ var_dump(session_destroy()); ob_end_flush(); ?> --EXPECT-- +Deprecated: PHP Startup: Disabling session.use_only_cookies INI setting is deprecated in Unknown on line 0 + +Deprecated: PHP Startup: Enabling session.use_trans_sid INI setting is deprecated in Unknown on line 0 *** Testing basic session functionality : variation3 use_trans_sid *** *** Test trans sid *** diff --git a/ext/session/tests/session_basic4.phpt b/ext/session/tests/session_basic4.phpt index 93b04604d24..d1c8cdcd959 100644 --- a/ext/session/tests/session_basic4.phpt +++ b/ext/session/tests/session_basic4.phpt @@ -48,6 +48,9 @@ echo ' '; ?> --EXPECT-- +Deprecated: PHP Startup: Disabling session.use_only_cookies INI setting is deprecated in Unknown on line 0 + +Deprecated: PHP Startup: Enabling session.use_trans_sid INI setting is deprecated in Unknown on line 0 *** Testing basic session functionality : variation4 use_trans_sid *** *** Test trans sid *** diff --git a/ext/session/tests/session_basic5.phpt b/ext/session/tests/session_basic5.phpt index 4f1d39ee027..dd029b8aeeb 100644 --- a/ext/session/tests/session_basic5.phpt +++ b/ext/session/tests/session_basic5.phpt @@ -234,7 +234,12 @@ var_dump(session_destroy()); ob_end_flush(); ?> ---EXPECT-- +--EXPECTF-- +Deprecated: PHP Startup: Disabling session.use_only_cookies INI setting is deprecated in Unknown on line 0 + +Deprecated: PHP Startup: Enabling session.use_trans_sid INI setting is deprecated in Unknown on line 0 + +Deprecated: ini_set(): Usage of session.trans_sid_hosts INI setting is deprecated in %s on line 5 *** Testing basic session functionality : variation5 use_trans_sid *** *** Test trans sid *** diff --git a/ext/standard/tests/general_functions/bug44394_2.phpt b/ext/standard/tests/general_functions/bug44394_2.phpt index 356291318c8..c6107def029 100644 --- a/ext/standard/tests/general_functions/bug44394_2.phpt +++ b/ext/standard/tests/general_functions/bug44394_2.phpt @@ -5,12 +5,12 @@ session --INI-- session.name=PHPSESSID session.use_only_cookies=0 +session.use_trans_sid=1 session.trans_sid_tags="a=href,area=href,frame=src,form=" url_rewriter.tags="a=href,area=href,frame=src,form=" --FILE-- --EXPECTF-- +Deprecated: PHP Startup: Disabling session.use_only_cookies INI setting is deprecated in Unknown on line 0 + +Deprecated: PHP Startup: Enabling session.use_trans_sid INI setting is deprecated in Unknown on line 0 asd diff --git a/ext/standard/tests/general_functions/output_add_rewrite_var_basic1.phpt b/ext/standard/tests/general_functions/output_add_rewrite_var_basic1.phpt index 007772f408a..62ef24429b2 100644 --- a/ext/standard/tests/general_functions/output_add_rewrite_var_basic1.phpt +++ b/ext/standard/tests/general_functions/output_add_rewrite_var_basic1.phpt @@ -74,7 +74,10 @@ Test use_trans_sid=1
---EXPECT-- +--EXPECTF-- +Deprecated: ini_set(): Usage of session.trans_sid_hosts INI setting is deprecated in %s on line 5 + +Deprecated: ini_set(): Disabling session.use_only_cookies INI setting is deprecated in %s on line 6 Without session @@ -105,6 +108,8 @@ Test use_trans_sid=0
+ +Deprecated: ini_set(): Enabling session.use_trans_sid INI setting is deprecated in %s on line 50 Test use_trans_sid=1 diff --git a/ext/standard/tests/general_functions/output_add_rewrite_var_basic2.phpt b/ext/standard/tests/general_functions/output_add_rewrite_var_basic2.phpt index 3aba659c343..3f133669ad5 100644 --- a/ext/standard/tests/general_functions/output_add_rewrite_var_basic2.phpt +++ b/ext/standard/tests/general_functions/output_add_rewrite_var_basic2.phpt @@ -74,7 +74,8 @@ Test use_trans_sid=1
---EXPECT-- +--EXPECTF-- +Deprecated: ini_set(): Usage of session.trans_sid_hosts INI setting is deprecated in %s on line 5 Without session @@ -105,6 +106,8 @@ Test use_trans_sid=0 + +Deprecated: ini_set(): Enabling session.use_trans_sid INI setting is deprecated in %s on line 50 Test use_trans_sid=1 diff --git a/ext/standard/tests/general_functions/output_add_rewrite_var_basic3.phpt b/ext/standard/tests/general_functions/output_add_rewrite_var_basic3.phpt index 92cd59e4f45..7a407f9e1ca 100644 --- a/ext/standard/tests/general_functions/output_add_rewrite_var_basic3.phpt +++ b/ext/standard/tests/general_functions/output_add_rewrite_var_basic3.phpt @@ -73,7 +73,8 @@ Test use_trans_sid=1 ---EXPECT-- +--EXPECTF-- +Deprecated: ini_set(): Disabling session.use_only_cookies INI setting is deprecated in %s on line 5 Without session @@ -104,6 +105,8 @@ Test use_trans_sid=0 + +Deprecated: ini_set(): Enabling session.use_trans_sid INI setting is deprecated in %s on line 49 Test use_trans_sid=1 diff --git a/ext/standard/tests/general_functions/output_add_rewrite_var_basic4.phpt b/ext/standard/tests/general_functions/output_add_rewrite_var_basic4.phpt index 7dc1ecaa4b7..ae7f7a979e6 100644 --- a/ext/standard/tests/general_functions/output_add_rewrite_var_basic4.phpt +++ b/ext/standard/tests/general_functions/output_add_rewrite_var_basic4.phpt @@ -73,7 +73,7 @@ Test use_trans_sid=1 ---EXPECT-- +--EXPECTF-- Without session @@ -104,6 +104,8 @@ Test use_trans_sid=0 + +Deprecated: ini_set(): Enabling session.use_trans_sid INI setting is deprecated in %s on line 49 Test use_trans_sid=1 diff --git a/ext/standard/tests/general_functions/url_rewriting_basic1.phpt b/ext/standard/tests/general_functions/url_rewriting_basic1.phpt index 4c1f6784dcb..0bc3a64573c 100644 --- a/ext/standard/tests/general_functions/url_rewriting_basic1.phpt +++ b/ext/standard/tests/general_functions/url_rewriting_basic1.phpt @@ -76,7 +76,8 @@ session_start(); echo "\nURL-Rewriting with transparent session id support without output_add_rewrite_var()\n"; echo $testTags; ---EXPECT-- +--EXPECTF-- +Deprecated: ini_set(): Usage of session.trans_sid_hosts INI setting is deprecated in %s on line 44 URL-Rewriting with output_add_rewrite_var() without transparent session id support @@ -115,6 +116,10 @@ URL-Rewriting with output_add_rewrite_var() without transparent session id suppo
+Deprecated: ini_set(): Disabling session.use_only_cookies INI setting is deprecated in %s on line 60 + +Deprecated: ini_set(): Enabling session.use_trans_sid INI setting is deprecated in %s on line 63 + URL-Rewriting with transparent session id support without output_add_rewrite_var() diff --git a/ext/standard/tests/general_functions/url_rewriting_basic2.phpt b/ext/standard/tests/general_functions/url_rewriting_basic2.phpt index 635383a33c9..bed24209eee 100644 --- a/ext/standard/tests/general_functions/url_rewriting_basic2.phpt +++ b/ext/standard/tests/general_functions/url_rewriting_basic2.phpt @@ -87,7 +87,8 @@ output_add_rewrite_var('', ''); echo "\nURL-Rewriting with output_add_rewrite_var() without transparent session id support\n"; echo $testTags; ---EXPECT-- +--EXPECTF-- +Deprecated: ini_set(): Usage of session.trans_sid_hosts INI setting is deprecated in %s on line 44 URL-Rewriting with output_add_rewrite_var() without transparent session id support @@ -126,6 +127,10 @@ URL-Rewriting with output_add_rewrite_var() without transparent session id suppo
+Deprecated: ini_set(): Disabling session.use_only_cookies INI setting is deprecated in %s on line 61 + +Deprecated: ini_set(): Enabling session.use_trans_sid INI setting is deprecated in %s on line 64 + URL-Rewriting with transparent session id support without output_add_rewrite_var() diff --git a/ext/standard/tests/general_functions/url_rewriting_basic3.phpt b/ext/standard/tests/general_functions/url_rewriting_basic3.phpt index edf41ba4fe2..7a2eed0823d 100644 --- a/ext/standard/tests/general_functions/url_rewriting_basic3.phpt +++ b/ext/standard/tests/general_functions/url_rewriting_basic3.phpt @@ -80,7 +80,12 @@ output_add_rewrite_var('', ''); echo "\nURL-Rewriting with transparent session id support without output_add_rewrite_var()\n"; echo $testTags; ---EXPECT-- +--EXPECTF-- +Deprecated: ini_set(): Usage of session.trans_sid_hosts INI setting is deprecated in %s on line 44 + +Deprecated: ini_set(): Disabling session.use_only_cookies INI setting is deprecated in %s on line 47 + +Deprecated: ini_set(): Enabling session.use_trans_sid INI setting is deprecated in %s on line 50 URL-Rewriting with transparent session id support without output_add_rewrite_var() diff --git a/ext/standard/url_scanner_ex.re b/ext/standard/url_scanner_ex.re index 305be39d878..1ce7521d7fa 100644 --- a/ext/standard/url_scanner_ex.re +++ b/ext/standard/url_scanner_ex.re @@ -102,6 +102,9 @@ static zend_result php_ini_on_update_tags(zend_ini_entry *entry, zend_string *ne static PHP_INI_MH(OnUpdateSessionTags) { + if (!zend_string_starts_with_literal(new_value, "a=href,area=href,frame=src,form=")) { + php_error_docref("session.configuration", E_DEPRECATED, "Usage of session.trans_sid_tags INI setting is deprecated"); + } return php_ini_on_update_tags(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage, /* is_session */ true); } @@ -152,6 +155,9 @@ static zend_result php_ini_on_update_hosts(zend_ini_entry *entry, zend_string *n static PHP_INI_MH(OnUpdateSessionHosts) { + if (ZSTR_LEN(new_value) != 0) { + php_error_docref("session.configuration", E_DEPRECATED, "Usage of session.trans_sid_hosts INI setting is deprecated"); + } return php_ini_on_update_hosts(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage, /* is_session */ true); }