WordPress.org

Make WordPress Core

Opened 2 years ago

Closed 2 years ago

#20202 closed defect (bug) (fixed)

Filter pre_post_type with sanitize_key()

Reported by: duck_ Owned by: duck_
Milestone: 3.4 Priority: normal
Severity: normal Version: 3.1
Component: General Keywords: has-patch
Focuses: Cc:

Description

Currently the post_type field is sanitized with sanitize_user(). It would make more sense to use sanitize_key() for this because

  1. register_post_type() uses sanitize_key()
  2. It's a lighter function

See #14910.

Attachments (1)

20202.diff (611 bytes) - added by duck_ 2 years ago.

Download all attachments as: .zip

Change History (2)

duck_2 years ago

comment:1 duck_2 years ago

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

In [20234]:

Pass post_type through sanitize_key() instead of sanitize_user(). Fixes #20202.

For consistency with the registration API and because it does less work.

Note: See TracTickets for help on using tickets.