Make WordPress Core

Opened 17 years ago

Closed 17 years ago

#11123 closed defect (bug) (fixed)

Limit wp_get_recent_posts() to real/live posts

Reported by: josephscott Owned by:
Priority: normal Milestone: 2.9
Component: Trash Version: 2.9
Severity: normal Keywords: has-patch
Cc: Focuses:

Description

The WP function wp_get_recent_posts does a simple SELECT against the posts table to get data on recent posts. This function is currently only used by the mw_getRecentPosts() function (XML-RPC method metaWeblog.getRecentPosts) to provide clients with a list of recent WP posts.

A check for post_status needs to be added so that wp_get_recent_posts only returns data for "real" posts, ones with a post_status of 'draft', 'publish', 'future', 'pending', or 'private'.

With out this metaWeblog.getRecentPosts will return data for posts that have been deleted when trash is turned on.

Attachments (1)

wp-includes--post.php.diff​ (582 bytes ) - added by josephscott 17 years ago.

Download all attachments as: .zip

Change History (3)

#1 @ryan
17 years ago

  • Component General → Trash

#2 @azaozz
17 years ago

  • Resolution → fixed
  • Status new → closed

(In [12237]) Limit wp_get_recent_posts() to real/live posts, props josephscott, fixes #11123

Note: See TracTickets for help on using tickets.