summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJaime Perez Crespo <jaime.perez@uninett.no>2016-02-03 13:22:20 +0100
committerJaime Perez Crespo <jaime.perez@uninett.no>2016-02-03 13:22:20 +0100
commitd32eb4a928f5f0e256202ca244cf141411e4489d (patch)
tree66a73aba7e7119d2805c41e12eb1c95b97f64a9a
parent1ef7d624e911cc83d568ab7ac319b7323a427a35 (diff)
downloadsimplesamlphp-d32eb4a928f5f0e256202ca244cf141411e4489d.zip
simplesamlphp-d32eb4a928f5f0e256202ca244cf141411e4489d.tar.gz
simplesamlphp-d32eb4a928f5f0e256202ca244cf141411e4489d.tar.bz2
Make SimpleSAML\Utils\Config\Metadata::isHiddenFromDiscovery() resilient to all kinds of failures.
-rw-r--r--lib/SimpleSAML/Utils/Config/Metadata.php9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/SimpleSAML/Utils/Config/Metadata.php b/lib/SimpleSAML/Utils/Config/Metadata.php
index 9ec4720..3f6b1be 100644
--- a/lib/SimpleSAML/Utils/Config/Metadata.php
+++ b/lib/SimpleSAML/Utils/Config/Metadata.php
@@ -255,12 +255,11 @@ class Metadata
*
* @return boolean True if the entity should be hidden, false otherwise.
*/
- public static function isHiddenFromDiscovery($metadata)
+ public static function isHiddenFromDiscovery(array $metadata)
{
- if (array_key_exists(self::$ENTITY_CATEGORY, $metadata['EntityAttributes'])) {
- if (in_array(self::$HIDE_FROM_DISCOVERY, $metadata['EntityAttributes'][self::$ENTITY_CATEGORY])) {
- return true;
- }
+ try {
+ return in_array(self::$HIDE_FROM_DISCOVERY, $metadata['EntityAttributes'][self::$ENTITY_CATEGORY]);
+ } catch (\Exception $e) {
}
return false;
}