Make WordPress Core

Opened 18 years ago

Closed 15 years ago

Last modified 8 months ago

#4028 closed defect (bug) (fixed)

Importing WXR breaks serialized postmeta value

Reported by: takayukister's profile takayukister Owned by:
Milestone: 2.2 Priority: low
Severity: normal Version: 2.2
Component: Administration Keywords: import has-patch WXR
Focuses: Cc:

Description

When importing WordPress eXtended RSS (WXR), every element content get escaped by addslashes() in get_tag(). This is good for usual string. But when the content is serialized string like postmeta values, this breaks the serialized format and make WordPress disable to unserialize them.

Attachments (2)

import-wordpress.diff (572 bytes) - added by takayukister 18 years ago.
I wrote a patch whitch try to unserialize.
wordpress_import_meta_serialized.patch (1.5 KB) - added by JonathanRogers 15 years ago.
Avoids serializing meta values when importing from WXR

Download all attachments as: .zip

Change History (12)

@takayukister
18 years ago

I wrote a patch whitch try to unserialize.

#1 @foolswisdom
17 years ago

  • Milestone changed from 2.3 to 2.2

#2 @foolswisdom
17 years ago

  • Keywords WXR added

#3 @ryan
17 years ago

Actually, nothing passed to add_post_meta should be escaped. Unlike most other functions, add_post_meta does it's own escaping. I think we just need to stripslashes() all postmeta values before handing off to add_post_meta.

#4 @ryan
17 years ago

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

(In [5249]) Stripslashes post meta values before handing off to add_post_meta. Use wpdb::escape instead of addslashes. Props takayukister. fixes #4028

#5 @JonathanRogers
15 years ago

  • Cc JonathanRogers added
  • Resolution fixed deleted
  • Status changed from closed to reopened
  • Version changed from 2.2 to 2.8.3

Unfortunately, this bug seems to have been re-introduced by Ticket #7347. Now, serialized post meta values are doubly serialized after importing. Since Ticket #7347 indicates there might be some reason for maybe_serialize() to doubly serialize (though I can't fathom what it might be) and add_post_meta() calls maybe_serialize(), I'm not sure where this should be fixed.

@JonathanRogers
15 years ago

Avoids serializing meta values when importing from WXR

#6 @dd32
15 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed
  • Version changed from 2.8.3 to 2.2

I think this would be better off in a new ticket JonathanRogers.

I'm going to reclose this, Could you open a new ticket related to it in the current version?

#7 @JonathanRogers
15 years ago

OK, the new one is Ticket #10619

This ticket was mentioned in PR #5571 on WordPress/wordpress-develop by noahtallen.


11 months ago
#8

Similar to #4028, updates the repository to NodeJS 20, which is now the current active LTS. Would supersede #5515 once v20 is on the build server!

noahtallen commented on PR #5571:


11 months ago
#9

Some of the Gutenberg failures above are because it's not yet on version 20 either.

noahtallen commented on PR #5571:


8 months ago
#10

Done elsewhere :)

Note: See TracTickets for help on using tickets.