# Bug in DOM document.c php_dom_ctx_error_level()

- Thread: https://externals.io/message/5852
- Original archive: https://news-web.php.net/php.internals/5852
- Started by Adam Maccabee Trachtenberg on 2003-12-01T08:10:16+00:00
- Messages: 2
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #5852 — Adam Maccabee Trachtenberg — 2003-12-01T08:10:16+00:00

URL: https://externals.io/message/5852#5852

The php_dom_ctx_error_level() function in DOM document.c assumes that
input->filename is always non-null. This is not true when the file is
an entity.

You can trigger this by killing your Internet connection and then
loading any XML file that references an external entity. For example:

<!ENTITY % HTMLlat1 PUBLIC
 "-//W3C//ENTITIES Latin 1 for XHTML//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent">
%HTMLlat1;
]>

A patch to fix this is available at:
http://www.trachtenberg.com/patches/php_dom_ctx_error_level.txt

-adam

-- 
adam@trachtenberg.com

---

## #5853 — Christian Stocker — 2003-12-01T08:19:12+00:00

URL: https://externals.io/message/5852#5853 · In reply to: #5852

hi adam

it's commited.

thanks fot the patch

chregu


> The php_dom_ctx_error_level() function in DOM document.c assumes that
> input->filename is always non-null. This is not true when the file is
> an entity.
> 
> You can trigger this by killing your Internet connection and then
> loading any XML file that references an external entity. For example:
> 
> <!ENTITY % HTMLlat1 PUBLIC
>  "-//W3C//ENTITIES Latin 1 for XHTML//EN"
>  "http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent">
> %HTMLlat1;
> ]>
> 
> A patch to fix this is available at:
> http://www.trachtenberg.com/patches/php_dom_ctx_error_level.txt
> 
> -adam
> 

-- 
christian stocker | Bitflux GmbH | schoeneggstrasse 5 | ch-8004 zurich
phone +41 1 240 56 70 | mobile +41 76 561 88 60  | fax +41 1 240 56 71
http://www.bitflux.ch  |  chregu@bitflux.ch  |  gnupg-keyid 0x5CE1DECB
