Skip to content

Commit ec5bd25

Browse files
Merge branch '3.4' into 4.4
* 3.4: [HttpFoundation] workaround PHP bug in the session module
2 parents 1055c11 + eded33d commit ec5bd25

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

Session/Storage/Handler/AbstractSessionHandler.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,15 @@ public function validateId($sessionId)
7171
$this->prefetchData = $this->read($sessionId);
7272
$this->prefetchId = $sessionId;
7373

74+
if (\PHP_VERSION_ID < 70317 || (70400 <= \PHP_VERSION_ID && \PHP_VERSION_ID < 70405)) {
75+
// work around https://bugs.php.net/79413
76+
foreach (debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS) as $frame) {
77+
if (!isset($frame['class']) && isset($frame['function']) && \in_array($frame['function'], ['session_regenerate_id', 'session_create_id'], true)) {
78+
return '' === $this->prefetchData;
79+
}
80+
}
81+
}
82+
7483
return '' !== $this->prefetchData;
7584
}
7685

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

Lines changed: 1 addition & 0 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy