WordPress.org

Make WordPress Core

Opened 10 years ago

Closed 9 years ago

Last modified 8 years ago

#1912 closed defect (bug) (fixed)

Postmeta Values may not be literal zeroes

Reported by: skippy Owned by:
Milestone: Priority: normal
Severity: major Version: 1.6
Component: Administration Keywords: postmeta metavalue bg|has-patch bg|commit
Focuses: Cc:

Description

The add_meta() function uses a simple if !empty($metavalue) check to determine whether a meta value has been supplied. empty() treats zeroes as false, so a literal zero as a postmeta value fails. The attached patch fixes it. The patch DOES NOT allow a zero for a postmeta key.

Attachments (1)

zero-postmeta-value.diff (730 bytes) - added by skippy 10 years ago.

Download all attachments as: .zip

Change History (3)

comment:1 @matt9 years ago

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

(In [3221]) Allow 0 for postmeta, fixes #1912

comment:2 @anonymous8 years ago

  • Milestone 2.0 deleted

Milestone 2.0 deleted

Note: See TracTickets for help on using tickets.