From 0d68da50aca677e953e19a385c0819c3902e2330 Mon Sep 17 00:00:00 2001 From: julienmiclo Date: Tue, 4 Sep 2018 18:19:44 +0200 Subject: [PATCH] fix(WPML): fix Countable warning Warning: count(): Parameter must be an array or an object that implements Countable in gdpr-framework/src/Modules/WPML/WPML.php on line 81 --- src/Modules/WPML/WPML.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Modules/WPML/WPML.php b/src/Modules/WPML/WPML.php index b720c2a..0487d57 100644 --- a/src/Modules/WPML/WPML.php +++ b/src/Modules/WPML/WPML.php @@ -78,7 +78,7 @@ public function getConsentTypes($consentTypes) $code = (string)ICL_LANGUAGE_CODE; $filteredConsentTypes = []; - if (count($consentTypes)) { + if (is_array($consentTypes) && count($consentTypes)) { foreach ($consentTypes as $consentType) { if (isset($consentType['slug']) && ('privacy-policy' === $consentType['slug'] or 'terms-condition' === $consentType['slug'])) {