﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc
11744	the global-posts bucket potentially contains garbage	Denis-de-Bernardy	ryan	"the newly introduced get_blog_post() function potentially contains garbage and is insufficiently cleaned up. it uses the following logic:

{{{
wp_cache_get(""$blog_id-$post_id"", ""global-posts"");
if false then
  select post regardless of status (can be trashed, draft, pending...)
  wp_cache_add() the thing in memcache
}}}

the issue is the cleanup:

{{{
function clear_global_post_cache( $post_id ) {
	global $wpdb;

	wp_cache_delete( $wpdb->blogid . '-' . $post_id, 'global-posts' );
}
add_action( 'publish_post', 'clear_global_post_cache' );
add_action( 'delete_post', 'clear_global_post_cache' );
}}}

if a published post gets turned back to pending status, for instance, the global-posts bucket will still contain the cached post. we should use the save_post hook instead.

"	defect (bug)	closed	normal	3.0	Cache	3.0	normal	fixed	has-patch multisite	
