Ticket #1955: trackback.patch
| File trackback.patch, 1.5 KB (added by drssay, 6 years ago) |
|---|
-
wp-trackback.php
old new 6 6 } 7 7 8 8 function trackback_response($error = 0, $error_message = '') { 9 header('Content-Type: text/xml; charset= ' . get_option('blog_charset'));9 header('Content-Type: text/xml; charset=utf-8' ); 10 10 if ($error) { 11 11 echo '<?xml version="1.0" encoding="utf-8"?'.">\n"; 12 12 echo "<response>\n"; … … 34 34 $title = $_POST['title']; 35 35 $excerpt = $_POST['excerpt']; 36 36 $blog_name = $_POST['blog_name']; 37 $charset = $_POST['charset']; 37 $headers = apache_request_headers(); 38 $charset = substr (stristr ($headers['Content-Type'], 'charset='), 8); 38 39 39 if ($charset) 40 if ($charset) { 40 41 $charset = strtoupper( trim($charset) ); 41 else42 } else 42 43 $charset = 'ASCII, UTF-8, ISO-8859-1, JIS, EUC-JP, SJIS'; 43 44 44 45 if ( function_exists('mb_convert_encoding') ) { // For international trackbacks 45 46 $title = mb_convert_encoding($title, get_settings('blog_charset'), $charset); 46 47 $excerpt = mb_convert_encoding($excerpt, get_settings('blog_charset'), $charset); 47 48 $blog_name = mb_convert_encoding($blog_name, get_settings('blog_charset'), $charset); 49 } else if ( function_exists('iconv') ) { 50 $title = iconv($charset, get_settings('blog_charset'), $title); 51 $excerpt = iconv($charset, get_settings('blog_charset'), $excerpt); 52 $blog_name = iconv($charset, get_settings('blog_charset'), $blog_name); 48 53 } 49 54 50 55 if ( is_single() || is_page() )
