WordPress.org

Make WordPress Core

Opened 8 years ago

Closed 8 years ago

#4571 closed defect (bug) (fixed)

broken option values after saving

Reported by: m0n5t3r Owned by: markjaquith
Milestone: 2.3 Priority: high
Severity: major Version: 2.3
Component: Administration Keywords: has-patch
Focuses: Cc:

Description

options.php calls trim and stripslashes on option values submitted from options pages.

When one of the values is an array, this breaks it and update_option saves the string "Array" in the database, which is, most of the times, not what the (plugin) options page author intended.

Attachments (2)

fix_option_parsing.diff (2.1 KB) - added by m0n5t3r 8 years ago.
patch to address the issue
4571.diff (517 bytes) - added by Nazgul 8 years ago.

Download all attachments as: .zip

Change History (5)

@m0n5t3r8 years ago

patch to address the issue

comment:1 @markjaquith8 years ago

  • Keywords needs-patch added; has-patch needs-testing 2nd-opinion removed
  • Owner changed from anonymous to markjaquith
  • Status changed from new to assigned
  • Version set to 2.3

see stripslashes_deep() We don't need to be trimming within the array.

@Nazgul8 years ago

comment:2 @Nazgul8 years ago

  • Keywords has-patch added; needs-patch removed

New patch attached.

comment:3 @ryan8 years ago

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

(In [5886]) Don't trim option arrays on save. Props m0n5t3r, Nazgul. fixes #4571

Note: See TracTickets for help on using tickets.