php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #77040 tidyNode::isHtml() is completely broken
Submitted: 2018-10-19 22:57 UTC Modified: 2020-10-07 10:56 UTC
From: cmb@php.net Assigned: cmb (profile)
Status: Closed Package: Tidy (PECL)
PHP Version: master-Git-2018-10-19 (Git) OS: *
Private report: No CVE-ID: None
 [2018-10-19 22:57 UTC] cmb@php.net
Description:
------------
From looking at the implementation[1], tidyNode::isHtml() is
presumably supposed to check whether the node is a start, end or
empty tag.  However, it uses members of the TidyNodeType enum[2]
as if these were bitfields, which they are not.  Therefore it
matches all node types except TidyNode_CDATA.

The documentation states[3]:

| Checks if a node is part of a HTML document

This does neither match the implementation, nor what the method
presumably is supposed to do.

[1] <https://github.com/php/php-src/blob/php-7.3.0RC3/ext/tidy/tidy.c#L1785-L1794>
[2] <http://api.html-tidy.org/tidy/tidylib_api_5.0.0/tidyenum_8h.html#a4af7ceeebf0ce18b70ed74f5db2cdf72>
[3] <http://php.net/manual/en/tidynode.ishtml.php>


Patches

Pull Requests

Pull requests:

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-10-07 10:56 UTC] cmb@php.net
-Assigned To: +Assigned To: cmb
 [2020-10-07 10:56 UTC] cmb@php.net
The following pull request has been associated:

Patch Name: Fix #77040: tidyNode::isHtml() is completely broken
On GitHub:  https://github.com/php/php-src/pull/6290
Patch:      https://github.com/php/php-src/pull/6290.patch
 [2020-10-07 15:51 UTC] cmb@php.net
Automatic comment on behalf of cmbecker69@gmx.de
Revision: http://git.php.net/?p=php-src.git;a=commit;h=e68acd031db679ff882710ce89bfac67e65bd9f0
Log: Fix #77040: tidyNode::isHtml() is completely broken
 [2020-10-07 15:51 UTC] cmb@php.net
-Status: Assigned +Status: Closed
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 09:01:32 2024 UTC