diff --git a/modules/consent/lib/Auth/Process/Consent.php b/modules/consent/lib/Auth/Process/Consent.php
index bfad8176aa45d11f2d32c1fb6683eaf0e1c41ff8..ee9837861a3e696e9f07cee6e736a02e1d0b05d0 100644
--- a/modules/consent/lib/Auth/Process/Consent.php
+++ b/modules/consent/lib/Auth/Process/Consent.php
@@ -160,7 +160,7 @@ class sspmod_consent_Auth_Process_Consent extends SimpleSAML_Auth_ProcessingFilt
                     return true;
                 } else {
                     // Search in multidimensional arrays
-                    foreach ($optionToTest in $option) {
+                    foreach ($option as $optionToTest) {
                         if (is_array($optionToTest)) {
                             if (array_key_exists('type', $optionToTest) { 
                                 if ($optionToTest['type'] === 'regex') {