From 9555a89f0b94f1f33f830ddf6943e6d24802ff1f Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Mon, 1 Oct 2012 21:56:20 +0000 Subject: [PATCH] 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 --- wp-includes/link-template.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/wp-includes/link-template.php b/wp-includes/link-template.php index 403e86ab2f..43468ea067 100644 --- a/wp-includes/link-template.php +++ b/wp-includes/link-template.php @@ -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);