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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: marco dot marsala at live dot it
New email:
PHP Version: OS:

 

 [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

Add a Patch

Pull Requests

Pull requests:

Add a Pull Request

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: Thu Apr 18 18:01:28 2024 UTC