Make WordPress Core

Opened 18 years ago

Closed 17 years ago

#4242 closed defect (bug) (fixed)

Export function does not define comments as CDATA

Reported by: ionfish's profile ionfish Owned by: westi's profile westi
Milestone: 2.5 Priority: normal
Severity: normal Version: 2.3
Component: Administration Keywords: has-patch needs-testing
Focuses: 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 (2)

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

Download all attachments as: .zip

Change History (7)

#1 @nbachiyski
18 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
18 years ago

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

#3 @westi
17 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
17 years ago

Updated patch to apply to trunk

#4 @westi
17 years ago

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

#5 @westi
17 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.