summaryrefslogtreecommitdiffstats
path: root/lib/SimpleSAML/Utils
diff options
context:
space:
mode:
authorJaime Perez Crespo <jaime.perez@uninett.no>2016-02-16 09:19:44 +0100
committerJaime Perez Crespo <jaime.perez@uninett.no>2016-02-16 09:19:44 +0100
commit69f67dc34083c60d3fc8e3601472f2e6be5cdd0f (patch)
tree40831bada0b99b0b0550dee09d9bddf045972888 /lib/SimpleSAML/Utils
parentf2039e052a7f8192b20664996067a4977439d1ea (diff)
downloadsimplesamlphp-69f67dc34083c60d3fc8e3601472f2e6be5cdd0f.zip
simplesamlphp-69f67dc34083c60d3fc8e3601472f2e6be5cdd0f.tar.gz
simplesamlphp-69f67dc34083c60d3fc8e3601472f2e6be5cdd0f.tar.bz2
Desist on the optimization introduced in d32eb4a, it doesn't work.
Diffstat (limited to 'lib/SimpleSAML/Utils')
-rw-r--r--lib/SimpleSAML/Utils/Config/Metadata.php28
1 files changed, 24 insertions, 4 deletions
diff --git a/lib/SimpleSAML/Utils/Config/Metadata.php b/lib/SimpleSAML/Utils/Config/Metadata.php
index 3ac022b..3e50fab 100644
--- a/lib/SimpleSAML/Utils/Config/Metadata.php
+++ b/lib/SimpleSAML/Utils/Config/Metadata.php
@@ -257,10 +257,30 @@ class Metadata
*/
public static function isHiddenFromDiscovery(array $metadata)
{
- try {
- return @in_array(self::$HIDE_FROM_DISCOVERY, $metadata['EntityAttributes'][self::$ENTITY_CATEGORY]);
- } catch (\Exception $e) {
+ if (!is_array($metadata)) {
+ return false;
}
- 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;
}
}