Skip to content

Commit 0fff786

Browse files
committed
Explicitly disable the loading of external entities
1 parent 3ace522 commit 0fff786

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/DOMDocumentFactory.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use function file_get_contents;
1515
use function libxml_clear_errors;
1616
use function libxml_get_last_error;
17+
use function libxml_set_external_entity_loader;
1718
use function libxml_use_internal_errors;
1819
use function sprintf;
1920

@@ -30,6 +31,7 @@ final class DOMDocumentFactory
3031
*/
3132
public static function fromString(string $xml): DOMDocument
3233
{
34+
libxml_set_external_entity_loader(null);
3335
Assert::notWhitespaceOnly($xml);
3436

3537
$internalErrors = libxml_use_internal_errors(true);

0 commit comments

Comments
 (0)