mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 01:27:36 +01:00
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: http://core.svn.wordpress.org/trunk@22095 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
b4d0be2d1a
commit
9555a89f0b
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user