Do not modify the post object in get_adjacent_post_rel_link(). Prior to 3.5 this could have poisioned the post's cache. props mdawaffe, fixes #22072.

git-svn-id: https://develop.svn.wordpress.org/trunk@22095 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2012-10-01 21:56:20 +00:00
parent 7790af3154
commit 7f2ab732c4
1 changed files with 4 additions and 2 deletions

View File

@ -1214,11 +1214,13 @@ function get_adjacent_post_rel_link($title = '%title', $in_same_cat = false, $ex
return;
if ( empty($post->post_title) )
$post->post_title = $previous ? __('Previous Post') : __('Next Post');
$post_title = $previous ? __('Previous Post') : __('Next Post');
else
$post_title = $post->post_title;
$date = mysql2date(get_option('date_format'), $post->post_date);
$title = str_replace('%title', $post->post_title, $title);
$title = str_replace('%title', $post_title, $title);
$title = str_replace('%date', $date, $title);
$title = apply_filters('the_title', $title, $post->ID);