php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #80268 HTML string containing ASCII character \0 breaks DomDocument
Submitted: 2020-10-22 08:28 UTC Modified: 2020-10-22 09:11 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: marco dot marsala at live dot it Assigned: cmb (profile)
Status: Closed Package: DOM XML related
PHP Version: 7.3.23 OS: Windows and Linux
Private report: No CVE-ID: None
 [2020-10-22 08:28 UTC] marco dot marsala at live dot it
Description:
------------
HTML string containing ASCII character \0 breaks DomDocument.

Test script:
---------------
$dom = new DomDocument;
$dom->loadHTML(file_get_contents('http://thenetworksolution.it/a.htm'));
echo $dom->saveHtml();


Expected result:
----------------
the whole DOM

Actual result:
--------------
DOM is truncated after the NUL character

Patches

Pull Requests

Pull requests:

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-10-22 09:11 UTC] cmb@php.net
-Status: Open +Status: Verified -Assigned To: +Assigned To: cmb
 [2020-10-22 09:43 UTC] cmb@php.net
The following pull request has been associated:

Patch Name: Fix #80268: loadHTML() truncates at NUL bytes
On GitHub:  https://github.com/php/php-src/pull/6368
Patch:      https://github.com/php/php-src/pull/6368.patch
 [2020-10-26 12:16 UTC] cmb@php.net
Automatic comment on behalf of cmbecker69@gmx.de
Revision: http://git.php.net/?p=php-src.git;a=commit;h=6d2bc7253018baa57487f622e706b8962c16d148
Log: Fix #80268: loadHTML() truncates at NUL bytes
 [2020-10-26 12:16 UTC] cmb@php.net
-Status: Verified +Status: Closed
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 15:01:29 2024 UTC