WordPress.org

Make WordPress Core

Opened 12 years ago

Closed 12 years ago

#4242 closed defect (bug) (fixed)

Export function does not define comments as CDATA

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

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 (2)

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

Download all attachments as: .zip

Change History (7)

#1 @nbachiyski
12 years ago

  • 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?

#2 @foolswisdom
12 years ago

  • Milestone changed from 2.4 (future) to 2.3 (trunk)

#3 @westi
12 years ago

  • 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?

@westi
12 years ago

Updated patch to apply to trunk

#4 @westi
12 years ago

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

#5 @westi
12 years ago

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

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

Note: See TracTickets for help on using tickets.