From 63da97fd3db71c0994b5cb639d41b17ed239a332 Mon Sep 17 00:00:00 2001 From: Anselm Hannemann Date: Mon, 13 May 2024 11:21:05 +0200 Subject: [PATCH] Fix isFeatureAllowed string comparison This fixes #20. This also should fix #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. --- CookieBanner.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CookieBanner.php b/CookieBanner.php index a22f094..fea2c89 100644 --- a/CookieBanner.php +++ b/CookieBanner.php @@ -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