WordPress.org

Make WordPress Core


Ignore:
Timestamp:
05/13/2014 04:43:22 AM (7 years ago)
Author:
wonderboymusic
Message:

Eliminate use of extract() in trackback_url_list().

See #22400.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/post.php

    r28332 r28382  
    38213821 * @param int $post_id Post ID
    38223822 */
    3823 function trackback_url_list($tb_list, $post_id) {
     3823function trackback_url_list( $tb_list, $post_id ) {
    38243824    if ( ! empty( $tb_list ) ) {
    38253825        // get post data
    3826         $postdata = get_post($post_id, ARRAY_A);
    3827 
    3828         // import postdata as variables
    3829         extract($postdata, EXTR_SKIP);
     3826        $postdata = get_post( $post_id, ARRAY_A );
    38303827
    38313828        // form an excerpt
    3832         $excerpt = strip_tags($post_excerpt ? $post_excerpt : $post_content);
    3833 
    3834         if (strlen($excerpt) > 255) {
    3835             $excerpt = substr($excerpt,0,252) . '…';
     3829        $excerpt = strip_tags( $postdata['post_excerpt'] ? $postdata['post_excerpt'] : $postdata['post_content'] );
     3830
     3831        if ( strlen( $excerpt ) > 255 ) {
     3832            $excerpt = substr( $excerpt, 0, 252 ) . '…';
    38363833        }
    38373834
    3838         $trackback_urls = explode(',', $tb_list);
    3839         foreach( (array) $trackback_urls as $tb_url) {
    3840             $tb_url = trim($tb_url);
    3841             trackback($tb_url, wp_unslash($post_title), $excerpt, $post_id);
     3835        $trackback_urls = explode( ',', $tb_list );
     3836        foreach( (array) $trackback_urls as $tb_url ) {
     3837            $tb_url = trim( $tb_url );
     3838            trackback( $tb_url, wp_unslash( $postdata['post_title'] ), $excerpt, $post_id );
    38423839        }
    38433840    }
Note: See TracChangeset for help on using the changeset viewer.