Package: php-xml
Version: 8.4.27-1
Severity: normal
Hi,
When parsing XML/HTML with DomDocument, any errors are no longer shown.
E.g.
❯ cat test.php
<?php
$doc = new DomDocument();
$doc->loadHtml("<foo bar=\">blaa</foo>");
❯ PHPRC=/etc/php/8.4/mods-available/dom.ini PHP_INI_SCAN_DIR=/dev/null
php8.5 test.php
(no output)
When using PHP8.4 from stable (8.4.24-1~deb13u1), I get the expected output:
❯ PHPRC=/etc/php/8.4/mods-available/dom.ini PHP_INI_SCAN_DIR=/dev/null
php8.4 test.php
Warning: DOMDocument::loadHTML(): AttValue: " expected in Entity, line: 1
in /home/matthijs/test/test.php on line 3
Warning: DOMDocument::loadHTML(): Tag foo invalid in Entity, line: 1 in
/home/matthijs/test/test.php on line 3
Warning: DOMDocument::loadHTML(): Couldn't find end of Start Tag foo in
Entity, line: 1 in /home/matthijs/test/test.php on line 3
I've seen the issue on both 8.4.27-1 from unstable, as well as
8.5.9-0ubuntu1 from Ubuntu Stonking, both of which link against
libxml2-16 verson 2.15.4+dfsg-1 (installed from Ubuntu Stonking). The
issue also happens with 2.15.4+dfsg-1+b1 from unstable.
The PHP8.4 from stable links against libxml2 version
2.12.7+dfsg+really2.9.14-2.1+deb13u3 from stable (but is also broken
with 2.12.7+dfsg+really2.9.14-2.4 from unstable).
This could very well be an issue in libxml, but xmllint (from
libxml2-utils, linking against the same libxml2-16 package) does show
the errors, so this *seems* like an issue in the PHP extension.
❯ cat test.xml
<foo bar=\">blaa</foo>
❯ xmllint test.xml
test.xml:1: parser error : AttValue: " or ' expected
<foo bar=\">blaa</foo>
^
test.xml:1: parser error : attributes construct error
<foo bar=\">blaa</foo>
^
test.xml:1: parser error : Couldn't find end of Start Tag foo line 1
<foo bar=\">blaa</foo>
^
Gr.
Matthijs
-- System Information:
Debian Release: forky/sid
APT prefers resolute-updates
APT policy: (990, 'resolute-updates'), (990, 'resolute-security'), (990,
'resolute-backports'), (990, 'resolute'), (50, 'stonking-updates'), (50,
'stonking-security'), (50, 'stonking'), (50, 'stable-updates'), (50,
'unstable'), (50, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 7.0.0-38-generic (SMP w/22 CPU threads; PREEMPT)
Kernel taint flags: TAINT_WARN
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
Versions of packages php-xml depends on:
ii php-common 2:101
ii php8.5-xml 8.5.9-0ubuntu1
php-xml recommends no packages.
php-xml suggests no packages.
-- no debconf information