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

Opened 3 months ago

Last modified 3 months ago

Using stripslashes malforms arrays for post metadata

Reported by: jacobsantos Assigned to: jacobsantos
Priority: highest omg bbq Milestone: 2.7
Component: General Version: 2.7
Severity: blocker Keywords: has-patch tested commit
Cc:

Description

In the database, the gallery has _wp_attachment_metadata set as "Array" this means that somewhere in the execution path, the meta data value was converted to a string. Following the execution has found that stripslashes() is the cause of the malformed array meta data values.

The patch solves this problem and keeps the stripslashes for strings. The recommendation is to remove the requirement that strings have slashes added in order to simplify the code.

Attachments

7871.r9124.diff (4.8 kB) - added by jacobsantos on 10/12/08 05:34:00.
Fix for malformed array in database based off of r9124

Change History

10/12/08 05:34:00 changed by jacobsantos

  • attachment 7871.r9124.diff added.

Fix for malformed array in database based off of r9124

10/12/08 16:00:45 changed by jacobsantos

  • summary changed from Using stripslashes malforms arrays to Using stripslashes malforms arrays for post metadata.

10/12/08 16:08:01 changed by jacobsantos

  • owner changed from anonymous to jacobsantos.

10/12/08 16:08:05 changed by jacobsantos

  • status changed from new to assigned.

10/12/08 16:17:01 changed by ShaneF

  • keywords set to commit.
  • version set to 2.7.

This is a major error. It even fixes problems I was having in #7607.

10/12/08 17:00:37 changed by jacobsantos

  • keywords changed from commit to has-patch tested commit.

10/12/08 23:15:36 changed by azaozz

Why not just use stripslashes_deep(). It works for both arrays and strings.

10/13/08 02:48:46 changed by azaozz

  • status changed from assigned to closed.
  • resolution set to fixed.

(In [9129]) Fix stripslashes for post metadata, phpDoc updates for media.php, props jacobsantos, fixes #7871

10/13/08 02:53:15 changed by ShaneF

I am going to test this later to make sure.