[wp-trac] [WordPress Trac] #19998: Feeds can contain characters that are not valid XML

WordPress Trac noreply at wordpress.org
Thu Mar 20 11:12:04 UTC 2025


#19998: Feeds can contain characters that are not valid XML
----------------------------------------+------------------------------
 Reporter:  westi                       |       Owner:  (none)
     Type:  defect (bug)                |      Status:  new
 Priority:  normal                      |   Milestone:  Awaiting Review
Component:  Feeds                       |     Version:  3.3.1
 Severity:  normal                      |  Resolution:
 Keywords:  has-patch needs-unit-tests  |     Focuses:
----------------------------------------+------------------------------

Comment (by abcd95):

 I'd like to propose an alternate solution for this. Instead of creating a
 new `strip_for_xml()` function, I believe updating the existing
 `esc_xml()` function would be more appropriate.

 The current `esc_xml()` function handles XML escaping but doesn't strip
 invalid XML characters. My patch enhances this function by stripping these
 characters according to the XML spec. It is also the **refreshed** version
 of the current fix in the context of the current codebase.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/19998#comment:18>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list