Ticket #4242 (closed defect (bug): fixed)

Opened 5 years ago

Last modified 4 years ago

Export function does not define comments as CDATA

Reported by: ionfish Owned by: westi
Priority: normal Milestone: 2.5
Component: Administration Version: 2.3
Severity: normal Keywords: has-patch needs-testing
Cc:

Description

Because comments aren't defined as CDATA, if they contain invalid characters (which is likely, given the public nature of comments) then data can be lost when the XML file WordPress generates is imported into a new database.

Attachments

export-cdata.diff Download (1.6 KB) - added by nbachiyski 5 years ago.
wxr-cdata.patch Download (1.8 KB) - added by westi 4 years ago.
Updated patch to apply to trunk

Change History

  • Keywords has-patch added

Here is a patch, witch adds the post content, the comment content and the dc:creator fields as CDATA sections. Are there any other that should be treated this way?

  • Milestone changed from 2.4 (future) to 2.3 (trunk)
  • Keywords needs-testing added; export comments CDATA removed
  • Owner changed from anonymous to westi
  • Status changed from new to assigned

Current patch doesn't apply

Uploading updated patch.

However a quick test of export from trunk with this change and import into branches/2.3 failed so this may need more work on the import side?

westi4 years ago

Updated patch to apply to trunk

meh. it looks like I missed an echo in my updated patch and no comments are being exported :-(

  • Status changed from assigned to closed
  • Resolution set to fixed

(In [7299]) Enclose more things as CDATA when exporting. Fixes #4242 props nbachiyski.

Note: See TracTickets for help on using tickets.