[Security] Removed unnecessary statement #14581
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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?
Unless…
It actually is needed, as we want
TokenProviderInterface
implementations to have a possibility to give aPersistentTokenInterface
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).