Skip to content

Commit 0313570

Browse files
Merge branch '5.4' into 6.0
* 5.4: Leverage str_contains/str_starts_with Leverage str_ends_with
2 parents 2d2233f + b1ade8f commit 0313570

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
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, mixed $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

0 commit comments

Comments
 (0)