diff options
author | Jaime Perez Crespo <jaime.perez@uninett.no> | 2016-02-26 10:16:42 +0100 |
---|---|---|
committer | Jaime Perez Crespo <jaime.perez@uninett.no> | 2016-02-26 10:16:42 +0100 |
commit | 2c050ee98dc0677547e4cf5cd917db9e3af45fe9 (patch) | |
tree | 7416ffb2466eb194cc62403eb11da9fdbf778818 /lib/SimpleSAML | |
parent | fd008b9e5b0d7a8e701db0d3771fb2be932af273 (diff) | |
download | simplesamlphp-2c050ee98dc0677547e4cf5cd917db9e3af45fe9.zip simplesamlphp-2c050ee98dc0677547e4cf5cd917db9e3af45fe9.tar.gz simplesamlphp-2c050ee98dc0677547e4cf5cd917db9e3af45fe9.tar.bz2 |
Take #2. Use the recently migrated SimpleSAML_Logger::maskErrors() and popErrorMask() methods to simplify code un SimpleSAML\Utils\Config\Metadata.
Diffstat (limited to 'lib/SimpleSAML')
-rw-r--r-- | lib/SimpleSAML/Utils/Config/Metadata.php | 30 |
1 files changed, 6 insertions, 24 deletions
diff --git a/lib/SimpleSAML/Utils/Config/Metadata.php b/lib/SimpleSAML/Utils/Config/Metadata.php index 3e50fab..1615ef6 100644 --- a/lib/SimpleSAML/Utils/Config/Metadata.php +++ b/lib/SimpleSAML/Utils/Config/Metadata.php @@ -257,30 +257,12 @@ class Metadata */ public static function isHiddenFromDiscovery(array $metadata) { - if (!is_array($metadata)) { - return false; + \SimpleSAML_Logger::maskErrors(E_ALL); + $hidden = in_array(self::$HIDE_FROM_DISCOVERY, $metadata['EntityAttributes'][self::$ENTITY_CATEGORY]); + \SimpleSAML_Logger::popErrorMask(); + if (is_bool($hidden)) { + return $hidden; } - - 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; + return false; } } |