Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9b3c298

Browse files
committed
simplified code
1 parent a10c07c commit 9b3c298

6 files changed

+6
-30
lines changed

src/Symfony/Component/Security/Guard/GuardAuthenticatorHandler.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,6 @@ private function migrateSession(Request $request)
140140
if (!$request->hasSession() || !$request->hasPreviousSession()) {
141141
return;
142142
}
143-
144-
// Destroying the old session is broken in php 5.4.0 - 5.4.10
145-
// See https://bugs.php.net/63379
146-
$destroy = \PHP_VERSION_ID < 50400 || \PHP_VERSION_ID >= 50411;
147-
$request->getSession()->migrate($destroy);
143+
$request->getSession()->migrate(true);
148144
}
149145
}

src/Symfony/Component/Security/Http/Firewall/AbstractPreAuthenticatedListener.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,6 @@ private function migrateSession(Request $request)
123123
if (!$request->hasSession() || !$request->hasPreviousSession()) {
124124
return;
125125
}
126-
127-
// Destroying the old session is broken in php 5.4.0 - 5.4.10
128-
// See https://bugs.php.net/63379
129-
$destroy = \PHP_VERSION_ID < 50400 || \PHP_VERSION_ID >= 50411;
130-
$request->getSession()->migrate($destroy);
126+
$request->getSession()->migrate(true);
131127
}
132128
}

src/Symfony/Component/Security/Http/Firewall/BasicAuthenticationListener.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,6 @@ private function migrateSession(Request $request)
9898
if (!$request->hasSession() || !$request->hasPreviousSession()) {
9999
return;
100100
}
101-
102-
// Destroying the old session is broken in php 5.4.0 - 5.4.10
103-
// See https://bugs.php.net/63379
104-
$destroy = \PHP_VERSION_ID < 50400 || \PHP_VERSION_ID >= 50411;
105-
$request->getSession()->migrate($destroy);
101+
$request->getSession()->migrate(true);
106102
}
107103
}

src/Symfony/Component/Security/Http/Firewall/DigestAuthenticationListener.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -141,11 +141,7 @@ private function migrateSession(Request $request)
141141
if (!$request->hasSession() || !$request->hasPreviousSession()) {
142142
return;
143143
}
144-
145-
// Destroying the old session is broken in php 5.4.0 - 5.4.10
146-
// See https://bugs.php.net/63379
147-
$destroy = \PHP_VERSION_ID < 50400 || \PHP_VERSION_ID >= 50411;
148-
$request->getSession()->migrate($destroy);
144+
$request->getSession()->migrate(true);
149145
}
150146
}
151147

src/Symfony/Component/Security/Http/Firewall/SimplePreAuthenticationListener.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,6 @@ private function migrateSession(Request $request)
129129
if (!$request->hasSession() || !$request->hasPreviousSession()) {
130130
return;
131131
}
132-
133-
// Destroying the old session is broken in php 5.4.0 - 5.4.10
134-
// See https://bugs.php.net/63379
135-
$destroy = \PHP_VERSION_ID < 50400 || \PHP_VERSION_ID >= 50411;
136-
$request->getSession()->migrate($destroy);
132+
$request->getSession()->migrate(true);
137133
}
138134
}

src/Symfony/Component/Security/Http/Session/SessionAuthenticationStrategy.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,7 @@ public function onAuthentication(Request $request, TokenInterface $token)
4949
case self::MIGRATE:
5050
// Note: this logic is duplicated in several authentication listeners
5151
// until Symfony 5.0 due to a security fix with BC compat
52-
53-
// Destroying the old session is broken in php 5.4.0 - 5.4.10
54-
// See https://bugs.php.net/63379
55-
$destroy = \PHP_VERSION_ID < 50400 || \PHP_VERSION_ID >= 50411;
56-
$request->getSession()->migrate($destroy);
52+
$request->getSession()->migrate(true);
5753

5854
return;
5955

0 commit comments

Comments
 (0)