Skip to content

Commit e47fdf8

Browse files
Merge branch '4.4' into 5.0
* 4.4: [HttpFoundation] workaround PHP bug in the session module [SecurityBundle] fix accepting env vars in remember-me configurations [Form] Fixed handling groups sequence validation [Cache] Avoid memory leak in TraceableAdapter::reset()
2 parents 284f865 + ec5bd25 commit e47fdf8

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

Session/Storage/Handler/AbstractSessionHandler.php

+9
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,15 @@ public function validateId($sessionId)
6464
$this->prefetchData = $this->read($sessionId);
6565
$this->prefetchId = $sessionId;
6666

67+
if (\PHP_VERSION_ID < 70317 || (70400 <= \PHP_VERSION_ID && \PHP_VERSION_ID < 70405)) {
68+
// work around https://bugs.php.net/79413
69+
foreach (debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS) as $frame) {
70+
if (!isset($frame['class']) && isset($frame['function']) && \in_array($frame['function'], ['session_regenerate_id', 'session_create_id'], true)) {
71+
return '' === $this->prefetchData;
72+
}
73+
}
74+
}
75+
6776
return '' !== $this->prefetchData;
6877
}
6978

Tests/Session/Storage/Handler/Fixtures/regenerate.expected

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ validateId
1111
read
1212
doRead: abc|i:123;
1313
read
14+
doRead: abc|i:123;
1415

1516
write
1617
doWrite: abc|i:123;

0 commit comments

Comments
 (0)