WordPress.org

Make WordPress Core

Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#20064 closed enhancement (fixed)

Editing a post of a non existing post type gives notices

Reported by: markoheijnen Owned by: duck_
Milestone: 3.4 Priority: normal
Severity: minor Version: 3.0
Component: Posts, Post Types Keywords: has-patch
Focuses: Cc:

Description

When you try to edit a post where the post type doesn't exists anymore you will get notices since the post type check is later then the capability check. Not a big thing tho.

Attachments (1)

20064.patch (958 bytes) - added by markoheijnen 2 years ago.

Download all attachments as: .zip

Change History (5)

markoheijnen2 years ago

comment:1 ocean902 years ago

  • Keywords has-patch added
  • Milestone changed from Awaiting Review to 3.4

comment:2 follow-up: nacin2 years ago

Seems fine, but can you actually "edit" a revision?

comment:3 duck_2 years ago

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

In [20623]:

Check that $post_type_object exists before accessing its properties. Props markoheijnen. Fixes #20064.

comment:4 in reply to: ↑ 2 duck_2 years ago

Replying to nacin:

Seems fine, but can you actually "edit" a revision?

Yes, but bad things happen. Per IRC: "surely this shouldn't be allowed?" -> put it on another ticket.

Note: See TracTickets for help on using tickets.