From 7f2ab732c4cf8d4251e48627cbcbab9af00669ba 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: https://develop.svn.wordpress.org/trunk@22095 602fd350-edb4-49c9-b593-d223f7449a82 --- 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);