Skip to content

Commit cc06e79

Browse files
Matthew Coveyfabpot
authored andcommitted
[HttpFoundation] Deprecate upload_progress.* and url_rewriter.tags session options
1 parent 2561c6b commit cc06e79

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ CHANGELOG
55
---
66

77
* Add the `litespeed_finish_request` method to work with Litespeed
8+
* Deprecate `upload_progress.*` and `url_rewriter.tags` session options
89

910
5.3
1011
---

Session/Storage/NativeSessionStorage.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,6 @@ class NativeSessionStorage implements SessionStorageInterface
9090
* use_cookies, "1"
9191
* use_only_cookies, "1"
9292
* use_trans_sid, "0"
93-
* upload_progress.enabled, "1"
94-
* upload_progress.cleanup, "1"
95-
* upload_progress.prefix, "upload_progress_"
96-
* upload_progress.name, "PHP_SESSION_UPLOAD_PROGRESS"
97-
* upload_progress.freq, "1%"
98-
* upload_progress.min-freq, "1"
99-
* url_rewriter.tags, "a=href,area=href,frame=src,form=,fieldset="
10093
* sid_length, "32"
10194
* sid_bits_per_character, "5"
10295
* trans_sid_hosts, $_SERVER['HTTP_HOST']
@@ -383,6 +376,13 @@ public function setOptions(array $options)
383376

384377
foreach ($options as $key => $value) {
385378
if (isset($validOptions[$key])) {
379+
if (str_starts_with($key, 'upload_progress.')) {
380+
trigger_deprecation('symfony/http-foundation', '5.4', 'Support for the "%s" session option is deprecated. The settings prefixed with "session.upload_progress." can not be changed at runtime.', $key);
381+
continue;
382+
}
383+
if ('url_rewriter.tags' === $key) {
384+
trigger_deprecation('symfony/http-foundation', '5.4', 'Support for the "%s" session option is deprecated. Use "trans_sid_tags" instead.', $key);
385+
}
386386
if ('cookie_samesite' === $key && \PHP_VERSION_ID < 70300) {
387387
// PHP < 7.3 does not support same_site cookies. We will emulate it in
388388
// the start() method instead.

Tests/Session/Storage/NativeSessionStorageTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,13 +195,13 @@ public function testCookieOptions()
195195
public function testSessionOptions()
196196
{
197197
$options = [
198-
'url_rewriter.tags' => 'a=href',
198+
'trans_sid_tags' => 'a=href',
199199
'cache_expire' => '200',
200200
];
201201

202202
$this->getStorage($options);
203203

204-
$this->assertSame('a=href', ini_get('url_rewriter.tags'));
204+
$this->assertSame('a=href', ini_get('session.trans_sid_tags'));
205205
$this->assertSame('200', ini_get('session.cache_expire'));
206206
}
207207

0 commit comments

Comments
 (0)