diff --git a/ext/session/session.c b/ext/session/session.c index 32de7c36d7813..346b3d74253ce 100644 --- a/ext/session/session.c +++ b/ext/session/session.c @@ -808,6 +808,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) @@ -825,12 +859,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) @@ -1478,7 +1512,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 { @@ -1486,7 +1520,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 1d6e9d65fe67e..3154022fae861 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 f504f120d6b10..5d9c6eb6261b1 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 873973f04bfc5..3fb64dbc076ae 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 02f712a9d871e..00d5779adf421 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 201aed60e056e..21a5f62c64312 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 4181becfef395..09e89e67ea1a8 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 dca5fc0c99068..c1217384ce850 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 414a8354d35fd..920f967d42f9b 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 d6a2ddb652746..44d6cface0538 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 9541121daa3b3..ad4783ee50cc3 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 1c16ab1c24e46..225a465f4c572 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 740c5410743f5..9a927a5419e4a 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 793e67cfadd44..916120cb4d447 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 0000000000000..4a2337fb99dad --- /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 7df9bffa770bc..97c0bfd617b70 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 0962a91bc4fe7..6e2cf22752947 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 cdfd3c833104b..2cb25e8d6929a 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 a928a6171c33c..4ca2048f0446e 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 dcfbe075cbf5b..eb45d7f4bbcd3 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 a7ddff14f5e72..5ab9983ea14b1 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 d6a771baf2164..693c3814ec0d2 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 e090ebec5d6e6..5dc6492050f4f 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 f227dd7d34300..8929556cdb0b3 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 8362f3b58d480..1a771935c4af0 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 fe01b5a8ba2aa..2a61ab98d9206 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 e1f2123b56a58..62bc17bd83831 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 661f48546d123..7ddeffaa48d37 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 93b04604d24d4..d1c8cdcd95928 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 4f1d39ee02701..dd029b8aeeb7b 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 356291318c8ba..c6107def029da 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 007772f408a3f..62ef24429b211 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 3aba659c34387..3f133669ad57a 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 92cd59e4f458e..7a407f9e1caa6 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 7dc1ecaa4b7d4..ae7f7a979e672 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 4c1f6784dcb2c..0bc3a64573ce2 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 635383a33c913..bed24209eee7c 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 edf41ba4fe200..7a2eed0823d9f 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 305be39d8780f..1ce7521d7fab1 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); }