Definition at line 9 of file DOMDocumentFactory.php.
◆ __construct()
SAML2\DOMDocumentFactory::__construct |
( |
| ) |
|
|
private |
◆ create()
static SAML2\DOMDocumentFactory::create |
( |
| ) |
|
|
static |
◆ fromFile()
static SAML2\DOMDocumentFactory::fromFile |
( |
|
$file | ) |
|
|
static |
- Parameters
-
- Returns
Definition at line 66 of file DOMDocumentFactory.php.
References $xml.
68 if (!is_string($file)) {
72 if (!is_file($file)) {
76 if (!is_readable($file)) {
82 $xml = file_get_contents($file);
85 'Contents of readable file "%s" could not be gotten',
90 if (trim(
$xml) ===
'') {
91 throw new RuntimeException(sprintf(
'File "%s" does not have content', $file));
94 return static::fromString(
$xml);
static invalidType($expected, $parameter)
◆ fromString()
static SAML2\DOMDocumentFactory::fromString |
( |
|
$xml | ) |
|
|
static |
- Parameters
-
- Returns
Definition at line 20 of file DOMDocumentFactory.php.
References PHPMailer\PHPMailer\$options, and $xml.
Referenced by sspmod_cas_Auth_Source_CAS\casServiceValidate(), sspmod_saml_IdP_SAML2\encodeAttributes(), SimpleSAML\Bindings\Shib13\Artifact\extractResponse(), SimpleSAML\Utils\XML\formatXMLString(), SimpleSAML\Utils\XML\isDOMNodeOfType(), sspmod_metarefresh_MetaLoader\loadXML(), SimpleSAML_Metadata_SAMLParser\parseDescriptorsFile(), SimpleSAML_Metadata_SAMLParser\parseDescriptorsString(), SimpleSAML_Metadata_SAMLParser\parseFile(), SimpleSAML_Metadata_SAMLParser\parseString(), SimpleSAML\Bindings\Shib13\HTTPPost\sendResponse(), SimpleSAML\XML\Shib13\AuthnResponse\setXML(), SimpleSAML_Metadata_Signer\sign(), sspmod_adfs_IdP_ADFS\signResponse(), SAML2\XML\Chunk\unserialize(), and SAML2\XML\saml\AttributeValue\unserialize().
22 if (!is_string(
$xml) || trim(
$xml) ===
'') {
26 $entityLoader = libxml_disable_entity_loader(
true);
27 $internalErrors = libxml_use_internal_errors(
true);
28 libxml_clear_errors();
30 $domDocument = self::create();
31 $options = LIBXML_DTDLOAD | LIBXML_DTDATTR | LIBXML_NONET;
32 if (defined(LIBXML_COMPACT)) {
38 libxml_use_internal_errors($internalErrors);
39 libxml_disable_entity_loader($entityLoader);
42 $error = libxml_get_last_error();
43 libxml_clear_errors();
45 throw new UnparseableXmlException($error);
48 libxml_clear_errors();
50 foreach ($domDocument->childNodes as $child) {
51 if ($child->nodeType === XML_DOCUMENT_TYPE_NODE) {
53 'Dangerous XML detected, DOCTYPE nodes are not allowed in the XML body' static invalidType($expected, $parameter)
The documentation for this class was generated from the following file: