Skip to content

Commit

Permalink
Fix isFeatureAllowed string comparison
Browse files Browse the repository at this point in the history
This fixes michnhokn#20.
This also should fix michnhokn#19.

The [`str_contains` function works vice-versa](https://www.php.net/manual/en/function.str-contains.php) than implemented before. In a local test environment this fixed the issues above and worked fine again.
  • Loading branch information
anselmh committed May 13, 2024
1 parent 2ebc4a5 commit 63da97f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion CookieBanner.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public static function isFeatureAllowed(string $featureName): bool
if (($cookie = self::getCookie()) === null) {
return false;
}
return str_contains($featureName, $cookie);
return str_contains($cookie, $featureName);
}

public static function allowedFeatures(): array
Expand Down

0 comments on commit 63da97f

Please sign in to comment.