WordPress.org

Make WordPress Core

Ticket #1955: 1955.diff

File 1955.diff, 1.3 KB (added by majelbstoat, 8 years ago)

Filter trackback charset.

  • wp-trackback.php

     
    3030        $tb_id = intval( $tb_id[ count($tb_id) - 1 ] ); 
    3131} 
    3232 
     33if ( is_single() || is_page() ) 
     34    $tb_id = $posts[0]->ID; 
     35 
     36if ( !intval( $tb_id ) ) 
     37        trackback_response(1, 'I really need an ID for this to work.'); 
     38 
    3339$tb_url    = $_POST['url']; 
    3440$title     = $_POST['title']; 
    3541$excerpt   = $_POST['excerpt']; 
     
    4147else 
    4248        $charset = 'ASCII, UTF-8, ISO-8859-1, JIS, EUC-JP, SJIS'; 
    4349 
     50$charset = apply_filters('trackback_charset', $charset); 
     51 
    4452if ( function_exists('mb_convert_encoding') ) { // For international trackbacks 
    4553        $title     = mb_convert_encoding($title, get_option('blog_charset'), $charset); 
    4654        $excerpt   = mb_convert_encoding($excerpt, get_option('blog_charset'), $charset); 
    4755        $blog_name = mb_convert_encoding($blog_name, get_option('blog_charset'), $charset); 
    4856} 
    4957 
    50 if ( is_single() || is_page() )  
    51     $tb_id = $posts[0]->ID; 
    52  
    53 if ( !intval( $tb_id ) ) 
    54         trackback_response(1, 'I really need an ID for this to work.'); 
    55  
    5658if (empty($title) && empty($tb_url) && empty($blog_name)) { 
    5759        // If it doesn't look like a trackback at all... 
    5860        wp_redirect(get_permalink($tb_id));