From db3af123e775b475dd8b7ae3df871fe44f786255 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=85kre=20Solberg?= <andreas.solberg@uninett.no> Date: Fri, 23 Oct 2009 19:12:57 +0000 Subject: [PATCH] Only list entities that are not expired... git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@1896 44740490-163a-0410-bde0-09ae8108e29a --- lib/SimpleSAML/Metadata/MetaDataStorageHandler.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/SimpleSAML/Metadata/MetaDataStorageHandler.php b/lib/SimpleSAML/Metadata/MetaDataStorageHandler.php index 86ea16706..1bc23c5d9 100644 --- a/lib/SimpleSAML/Metadata/MetaDataStorageHandler.php +++ b/lib/SimpleSAML/Metadata/MetaDataStorageHandler.php @@ -167,6 +167,16 @@ class SimpleSAML_Metadata_MetaDataStorageHandler { foreach($this->sources as $source) { $srcList = $source->getMetadataSet($set); + foreach($srcList AS $key => $le) { + if (array_key_exists('expire', $le)) { + if ($le['expire'] < time()) { + unset($srcList[$key]); + } + } + } + + + /* $result is the last argument to array_merge because we want the content already * in $result to have precedence. */ -- GitLab