Skip to content

Commit 1398105

Browse files
Merge branch '5.2' into 5.3
* 5.2: Leverage str_contains/str_starts_with Leverage str_ends_with
2 parents 8585f26 + d79f384 commit 1398105

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

Authorization/Voter/RoleVoter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function vote(TokenInterface $token, $subject, array $attributes)
3636
$roles = $this->extractRoles($token);
3737

3838
foreach ($attributes as $attribute) {
39-
if (!\is_string($attribute) || 0 !== strpos($attribute, $this->prefix)) {
39+
if (!\is_string($attribute) || !str_starts_with($attribute, $this->prefix)) {
4040
continue;
4141
}
4242

Encoder/MessageDigestPasswordEncoder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public function encodePassword(string $raw, ?string $salt)
7878
*/
7979
public function isPasswordValid(string $encoded, string $raw, ?string $salt)
8080
{
81-
if (\strlen($encoded) !== $this->encodedLength || false !== strpos($encoded, '$')) {
81+
if (\strlen($encoded) !== $this->encodedLength || str_contains($encoded, '$')) {
8282
return false;
8383
}
8484

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"require": {
1919
"php": ">=7.2.5",
2020
"symfony/event-dispatcher-contracts": "^1.1|^2",
21-
"symfony/polyfill-php80": "^1.15",
21+
"symfony/polyfill-php80": "^1.16",
2222
"symfony/service-contracts": "^1.1.6|^2",
2323
"symfony/deprecation-contracts": "^2.1",
2424
"symfony/password-hasher": "^5.3"

0 commit comments

Comments
 (0)