Skip to content
Snippets Groups Projects
Commit 36a883ec authored by Thijs Kinkhorst's avatar Thijs Kinkhorst
Browse files

Avoid PHP notices for remote SP entries without keys

parent 1f938af6
No related branches found
No related tags found
No related merge requests found
...@@ -330,8 +330,8 @@ class FederationController ...@@ -330,8 +330,8 @@ class FederationController
/** @var \SimpleSAML\Module\saml\Auth\Source\SP $source */ /** @var \SimpleSAML\Module\saml\Auth\Source\SP $source */
foreach (\SimpleSAML\Auth\Source::getSourcesOfType('saml:SP') as $source) { foreach (\SimpleSAML\Auth\Source::getSourcesOfType('saml:SP') as $source) {
$metadata = $source->getHostedMetadata(); $metadata = $source->getHostedMetadata();
$certificates = $metadata['keys']; $certificates = $metadata['keys'] ?? [];
if (count($metadata['keys']) === 1) { if (count($certificates) === 1) {
$cert = array_pop($metadata['keys']); $cert = array_pop($metadata['keys']);
$metadata['certData'] = $cert['X509Certificate']; $metadata['certData'] = $cert['X509Certificate'];
unset($metadata['keys']); unset($metadata['keys']);
......
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