Req #30875 [Ver]: xml_parse_into_struct() does not resolve entities in element content

From: Date: Tue, 09 Oct 2018 13:35:55 +0000
Subject: Req #30875 [Ver]: xml_parse_into_struct() does not resolve entities in element content
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-217484@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=30875&edit=1

 ID:                 30875
 Updated by:         cmb@php.net
 Reported by:        joern_h at gmx dot net
 Summary:            xml_parse_into_struct() does not resolve entities in
                     element content
 Status:             Verified
 Type:               Feature/Change Request
 Package:            XML related
 Operating System:   *
 PHP Version:        4CVS, 5CVS (2005-02-03)
 Block user comment: N
 Private report:     N

 New Comment:

> ext/xml just misses this functionality.

Well, actually it disables this functionality.  Therefore,
re-classifying as bug.

The problem is that xml_parse_into_struct() sets up a default
handler[1], but this handler doesn't do anything, since there is
no actual PHP handler installed[2].  This is basically the same as
this script[3]; simply removing the empty default handler[4]
solves the issue.

[1] <https://github.com/php/php-src/blob/php-7.3.0RC2/ext/xml/xml.c#L1437>
[2] <https://github.com/php/php-src/blob/php-7.3.0RC2/ext/xml/xml.c#L953-L967>
[3] <https://3v4l.org/PUrG6>
[4] <https://3v4l.org/lcEF0>


Previous Comments:
------------------------------------------------------------------------
[2018-03-14 14:24:05] cmb@php.net

Related To: Bug #35271

------------------------------------------------------------------------
[2016-06-29 18:40:59] cmb@php.net

> When using xml_parse_into_struct, entities from the internal dtd
> are not resolved in element content. Entities in attribute
> values are resolved properly.

Indeed, see <https://3v4l.org/8cgbf>. In my opinion, this
inconsistency is a bug.

------------------------------------------------------------------------
[2005-02-16 07:35:57] sniper@php.net

After some investigating of the issue: ext/xml just misses this functionality. No bug but feature
request -> reclassified.


------------------------------------------------------------------------
[2005-02-03 14:59:37] joern_h at gmx dot net

This bug still occurs with current PHP4 (Feb  3 2005 06:13:06) and PHP5 (Feb  3 2005 12:17:00)
snapshots.

------------------------------------------------------------------------
[2005-02-03 04:41:34] sniper@php.net

Please try using this CVS snapshot:

  http://snaps.php.net/php4-STABLE-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-STABLE-latest.zip



------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=30875


--
Edit this bug report at https://bugs.php.net/bug.php?id=30875&edit=1


Thread (8 messages)

« previous php.bugs (#217484) next »