Skip to content
Snippets Groups Projects
Commit 2c050ee9 authored by Jaime Perez Crespo's avatar Jaime Perez Crespo
Browse files

Take #2. Use the recently migrated SimpleSAML_Logger::maskErrors() and...

Take #2. Use the recently migrated SimpleSAML_Logger::maskErrors() and popErrorMask() methods to simplify code un SimpleSAML\Utils\Config\Metadata.
parent fd008b9e
No related branches found
No related tags found
No related merge requests found
...@@ -257,30 +257,12 @@ class Metadata ...@@ -257,30 +257,12 @@ class Metadata
*/ */
public static function isHiddenFromDiscovery(array $metadata) public static function isHiddenFromDiscovery(array $metadata)
{ {
if (!is_array($metadata)) { \SimpleSAML_Logger::maskErrors(E_ALL);
return false; $hidden = in_array(self::$HIDE_FROM_DISCOVERY, $metadata['EntityAttributes'][self::$ENTITY_CATEGORY]);
\SimpleSAML_Logger::popErrorMask();
if (is_bool($hidden)) {
return $hidden;
} }
return false;
if (!array_key_exists('EntityAttributes', $metadata)) {
return false;
}
if (!is_array($metadata['EntityAttributes'])) {
return false;
}
if (!array_key_exists(self::$ENTITY_CATEGORY, $metadata['EntityAttributes'])) {
return false;
}
if (!is_array($metadata['EntityAttributes'][self::$ENTITY_CATEGORY])) {
return false;
}
if (!in_array(self::$HIDE_FROM_DISCOVERY, $metadata['EntityAttributes'][self::$ENTITY_CATEGORY])) {
return false;
}
return true;
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment