Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 0cbca19

Browse filesBrowse files
[HttpFoundation] workaround PHP bug in the session module
1 parent a347a84 commit 0cbca19
Copy full SHA for 0cbca19

File tree

Expand file treeCollapse file tree

2 files changed

+10
-0
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+10
-0
lines changed

‎src/Symfony/Component/HttpFoundation/Session/Storage/Handler/AbstractSessionHandler.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpFoundation/Session/Storage/Handler/AbstractSessionHandler.php
+9Lines 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

‎src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/Fixtures/regenerate.expected

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/Fixtures/regenerate.expected
+1Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.