Make WordPress Core

Opened 20 years ago

Closed 17 years ago

Last modified 3 years ago

#4028 closed defect (bug) (fixed)

Importing WXR breaks serialized postmeta value

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

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 20 years ago.
I wrote a patch whitch try to unserialize.
wordpress_import_meta_serialized.patch​ (1.5 KB ) - added by JonathanRogers 17 years ago.
Avoids serializing meta values when importing from WXR

Download all attachments as: .zip

Change History (12)

@takayukister
20 years ago

I wrote a patch whitch try to unserialize.

#1 @foolswisdom
20 years ago

  • Milestone 2.3 → 2.2

#2 @foolswisdom
20 years ago

  • Keywords WXR added

#3 @ryan
20 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
20 years ago

  • Resolution → fixed
  • Status new → 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
17 years ago

  • Cc JonathanRogers added
  • Resolution fixed
  • Status closed → reopened
  • Version 2.2 → 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
17 years ago

Avoids serializing meta values when importing from WXR

#6 @dd32
17 years ago

  • Resolution → fixed
  • Status reopened → closed
  • Version 2.8.3 → 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
17 years ago

OK, the new one is Ticket #10619

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


3 years 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:


3 years ago
#9

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

​noahtallen commented on ​PR #5571:


3 years ago
#10

Done elsewhere :)

Note: See TracTickets for help on using tickets.