@@ -167,8 +167,10 @@ discard block |
||
| 167 | 167 | /* Do we have an attribute whitelist? */ |
| 168 | 168 | if (isset($source['attributewhitelist']) && !empty($source['attributewhitelist'])) { |
| 169 | 169 | $idpmetadata = $entity->getMetadata20IdP(); |
| 170 | - if (!isset($idpmetadata)) /* Skip non-IdPs */ |
|
| 170 | + if (!isset($idpmetadata)) { |
|
| 171 | + /* Skip non-IdPs */ |
|
| 171 | 172 | continue; |
| 173 | + } |
|
| 172 | 174 | |
| 173 | 175 | /* Do a recursive comparison for each whitelist of the attributewhitelist with the idpmetadata for this IdP. At least one of these whitelists should match */ |
| 174 | 176 | $match=0; |
@@ -178,8 +180,10 @@ discard block |
||
| 178 | 180 | break; |
| 179 | 181 | } |
| 180 | 182 | } |
| 181 | - if ($match==0) /* No match found -> next IdP */ |
|
| 183 | + if ($match==0) { |
|
| 184 | + /* No match found -> next IdP */ |
|
| 182 | 185 | continue; |
| 186 | + } |
|
| 183 | 187 | Logger::debug('Whitelisted entityID: '. $entity->getEntityID()); |
| 184 | 188 | } |
| 185 | 189 | |
@@ -237,8 +241,9 @@ discard block |
||
| 237 | 241 | /* key is number, check that the key appears as one |
| 238 | 242 | * of the destination keys: if not, then src has |
| 239 | 243 | * more keys than dst */ |
| 240 | - if (!array_key_exists($srckey, $dst)) |
|
| 241 | - return false; |
|
| 244 | + if (!array_key_exists($srckey, $dst)) { |
|
| 245 | + return false; |
|
| 246 | + } |
|
| 242 | 247 | |
| 243 | 248 | /* loop over dest keys, to find value: we don't know |
| 244 | 249 | * whether they are in the same order */ |
@@ -249,13 +254,15 @@ discard block |
||
| 249 | 254 | break; |
| 250 | 255 | } |
| 251 | 256 | } |
| 252 | - if ($submatch == 0) |
|
| 253 | - return false; |
|
| 257 | + if ($submatch == 0) { |
|
| 258 | + return false; |
|
| 259 | + } |
|
| 254 | 260 | } else { |
| 255 | 261 | /* key is regexp: find matching keys */ |
| 256 | 262 | $matchingdstkeys=preg_grep($srckey, $dstkeys); |
| 257 | - if (!is_array($matchingdstkeys)) |
|
| 258 | - return false; |
|
| 263 | + if (!is_array($matchingdstkeys)) { |
|
| 264 | + return false; |
|
| 265 | + } |
|
| 259 | 266 | |
| 260 | 267 | $match=0; |
| 261 | 268 | foreach ($matchingdstkeys as $dstkey) { |
@@ -265,8 +272,10 @@ discard block |
||
| 265 | 272 | break; |
| 266 | 273 | } |
| 267 | 274 | } |
| 268 | - if ($match==0) /* none of the keys has a matching value */ |
|
| 275 | + if ($match==0) { |
|
| 276 | + /* none of the keys has a matching value */ |
|
| 269 | 277 | return false; |
| 278 | + } |
|
| 270 | 279 | } |
| 271 | 280 | } |
| 272 | 281 | /* each src key/value matches */ |