19 declare(strict_types=1);
38 if ([] === $this->errorStack) {
39 $this->xmlErrorState = libxml_use_internal_errors(
true);
40 libxml_clear_errors();
45 $this->errorStack[] = [];
50 $currentErrors = libxml_get_errors();
51 libxml_clear_errors();
53 $level = count($this->errorStack) - 1;
54 $this->errorStack[$level] = array_merge($this->errorStack[$level], $currentErrors);
64 $errors = array_pop($this->errorStack);
66 if ([] === $this->errorStack) {
67 libxml_use_internal_errors($this->xmlErrorState);
83 $xml->registerXPathNamespace(
'md',
'urn:oasis:names:tc:SAML:2.0:metadata');
84 $xml->registerXPathNamespace(
'mdui',
'urn:oasis:names:tc:SAML:metadata:ui');
86 $idps = $xml->xpath(
'//md:EntityDescriptor[//md:IDPSSODescriptor]');
88 $entity_id = ($idps[0] ??
null)?->attributes(
'',
true)[
'entityID'][0] ??
'';
89 $entity_id = (string) $entity_id;
91 if ($entity_id !==
'') {
92 return $this->
ok($entity_id);
96 $error->level = LIBXML_ERR_FATAL;
98 $error->message =
'No entityID found';
102 return $this->
error([$error]);
104 return $this->
error();
112 return $this->dataFactory->ok($entity_id);
120 return $this->dataFactory->error($this->errorFormatter->formatErrors(...$this->endLogging(), ...$additional_errors));
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...