Skip to content

Commit e9cb3d2

Browse files
Merge branch '4.4' into 5.4
* 4.4: [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 1d3d261 + 73ed81e commit e9cb3d2

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
@@ -146,7 +146,7 @@ public function start()
146146
}
147147

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

Tests/Session/Storage/NativeSessionStorageTest.php

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

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

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

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

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

0 commit comments

Comments
 (0)