Skip to content
This repository was archived by the owner on May 31, 2024. It is now read-only.

Commit 432e908

Browse files
committed
minor #14581 [Security] Removed unnecessary statement (MacDada)
This PR was merged into the 2.7 branch. Discussion ---------- [Security] Removed unnecessary statement | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | ~ | License | MIT | Doc PR | ~ Removed unnecessary statement from `PersistentTokenBasedRememberMeServices.php`. `$series` comes from `$cookieParts` and `$this->tokenProvider->loadTokenBySeries($series);` is supposed to find the token with that value. Doing `$persistentToken->getSeries();` should give us exactly the same value, so it is an unnecessary statement. Why? * We don't need it? We won't miss it when it's gone. * It confuses a code reader who starts guessing why would that be needed (at least I did and lost time because of that). Unless… It actually is needed, as we want `TokenProviderInterface` implementations to have a possibility to give a `PersistentTokenInterface` with a different series value than asked… I can make a PR to the testing class so that such requirement is checked upon. I don't believe that this is BC, as this behaviour isn't documented anywhere and no existing (known to me) implementations return different series than the asked ones (and current tests pass successfully). Commits ------- c7a91f1 Removed unnecessary statement from PersistentTokenBasedRememberMeServices.php
2 parents 34bcfc3 + 78f5c20 commit 432e908

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

Http/RememberMe/PersistentTokenBasedRememberMeServices.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ protected function processAutoLoginCookie(array $cookieParts, Request $request)
9898
throw new AuthenticationException('The cookie has expired.');
9999
}
100100

101-
$series = $persistentToken->getSeries();
102101
$tokenValue = base64_encode($this->secureRandom->nextBytes(64));
103102
$this->tokenProvider->updateToken($series, $tokenValue, new \DateTime());
104103
$request->attributes->set(self::COOKIE_ATTR_NAME,

0 commit comments

Comments
 (0)