[php-src] Issue #11952: Confusing warning when blocking entity loading via libxml_set_external_entity_loader

From: Date: Sat, 12 Aug 2023 17:23:54 +0000
Subject: [php-src] Issue #11952: Confusing warning when blocking entity loading via libxml_set_external_entity_loader
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-245165@lists.php.net to get a copy of this message
Issue: https://github.com/php/php-src/issues/11952
Author: nielsdos

### Description

The following code:

```php
<?php

libxml_set_external_entity_loader(function ($public_id, $system_id, $context) {
    return null;
});

$doc = new DOMDocument;
$doc->loadHTMLFile("foobar");
```

Resulted in this output:
```
Warning: DOMDocument::loadHTMLFile(): Failed to load external entity "NULL" in %s on line
%d
```

But I expected something less confusing. Now it sounds like it tries to load a file named
"NULL" but that is not the case. It just complains in a weird way.
Low priority issue though.


### PHP Version

8.1+

### Operating System

_No response_


Thread (1 message)

  • nielsdos
« previous php.bugs (#245165) next »