WordPress.org

Make WordPress Core

Changeset 22095


Ignore:
Timestamp:
10/01/2012 09:56:20 PM (7 years ago)
Author:
nacin
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/link-template.php

    r21948 r22095  
    12151215
    12161216    if ( empty($post->post_title) )
    1217         $post->post_title = $previous ? __('Previous Post') : __('Next Post');
     1217        $post_title = $previous ? __('Previous Post') : __('Next Post');
     1218    else
     1219        $post_title = $post->post_title;
    12181220
    12191221    $date = mysql2date(get_option('date_format'), $post->post_date);
    12201222
    1221     $title = str_replace('%title', $post->post_title, $title);
     1223    $title = str_replace('%title', $post_title, $title);
    12221224    $title = str_replace('%date', $date, $title);
    12231225    $title = apply_filters('the_title', $title, $post->ID);
Note: See TracChangeset for help on using the changeset viewer.