Skip to content

Commit 25ae878

Browse files
Merge branch '5.4' into 6.0
* 5.4: [Mailer] fix tests [HttpFoundation] Prevent PHP Warning: Session ID is too long or contains illegal characters [Messenger] fix test [Messenger] Ceil waiting time when multiplier is a float on retry Spaces in system temp folder path cause deprecation errors in php 8
2 parents 9f9eb47 + e9cb3d2 commit 25ae878

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Session/Storage/NativeSessionStorage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ public function start(): bool
136136
}
137137

138138
$sessionId = $_COOKIE[session_name()] ?? null;
139-
if ($sessionId && $this->saveHandler instanceof AbstractProxy && 'files' === $this->saveHandler->getSaveHandlerName() && !preg_match('/^[a-zA-Z0-9,-]{22,}$/', $sessionId)) {
139+
if ($sessionId && $this->saveHandler instanceof AbstractProxy && 'files' === $this->saveHandler->getSaveHandlerName() && !preg_match('/^[a-zA-Z0-9,-]{22,250}$/', $sessionId)) {
140140
// the session ID in the header is invalid, create a new one
141141
session_id(session_create_id());
142142
}

Tests/Session/Storage/NativeSessionStorageTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ public function testRegenerateInvalidSessionIdForNativeFileSessionHandler()
292292
$started = $storage->start();
293293

294294
$this->assertTrue($started);
295-
$this->assertMatchesRegularExpression('/^[a-zA-Z0-9,-]{22,}$/', session_id());
295+
$this->assertMatchesRegularExpression('/^[a-zA-Z0-9,-]{22,250}$/', session_id());
296296
$storage->save();
297297

298298
$_COOKIE[session_name()] = '&~[';
@@ -301,7 +301,7 @@ public function testRegenerateInvalidSessionIdForNativeFileSessionHandler()
301301
$started = $storage->start();
302302

303303
$this->assertTrue($started);
304-
$this->assertMatchesRegularExpression('/^[a-zA-Z0-9,-]{22,}$/', session_id());
304+
$this->assertMatchesRegularExpression('/^[a-zA-Z0-9,-]{22,250}$/', session_id());
305305
$storage->save();
306306

307307
$_COOKIE[session_name()] = '&~[';

0 commit comments

Comments
 (0)