Ticket #25377: 25377.diff
| File 25377.diff, 3.2 KB (added by , 13 years ago) |
|---|
-
src/wp-trackback.php
1 1 <?php 2 2 /** 3 * Handle Trackbacks and Pingbacks sent to WordPress3 * Handle Trackbacks and Pingbacks Sent to WordPress 4 4 * 5 * @since 0.71 6 * 5 7 * @package WordPress 8 * @subpackage Trackbacks 6 9 */ 7 10 8 11 if (empty($wp)) { … … 11 14 } 12 15 13 16 /** 14 * trackback_response() - Respond with an error or success XML message17 * Response to a trackback. 15 18 * 16 * @param int|bool $error Whether there was an error 17 * @param string $error_message Error message if an error occurred 19 * Responds with an error or success XML message. 20 * 21 * @since 0.71 22 * 23 * @param int|bool $error Whether there was an error. 24 * Default '0'. Accepts '0' or '1'. 25 * @param string $error_message Error message if an error occurred. 18 26 */ 19 27 function trackback_response($error = 0, $error_message = '') { 20 28 header('Content-Type: text/xml; charset=' . get_option('blog_charset') ); … … 33 41 } 34 42 } 35 43 36 // trackback is done by a POST44 // Trackback is done by a POST. 37 45 $request_array = 'HTTP_POST_VARS'; 38 46 39 47 if ( !isset($_GET['tb_id']) || !$_GET['tb_id'] ) { … … 44 52 $tb_url = isset($_POST['url']) ? $_POST['url'] : ''; 45 53 $charset = isset($_POST['charset']) ? $_POST['charset'] : ''; 46 54 47 // These three are stripslashed here so th at they can be properly escaped after mb_convert_encoding()55 // These three are stripslashed here so they can be properly escaped after mb_convert_encoding(). 48 56 $title = isset($_POST['title']) ? wp_unslash($_POST['title']) : ''; 49 57 $excerpt = isset($_POST['excerpt']) ? wp_unslash($_POST['excerpt']) : ''; 50 58 $blog_name = isset($_POST['blog_name']) ? wp_unslash($_POST['blog_name']) : ''; … … 54 62 else 55 63 $charset = 'ASCII, UTF-8, ISO-8859-1, JIS, EUC-JP, SJIS'; 56 64 57 // No valid uses for UTF-7 65 // No valid uses for UTF-7. 58 66 if ( false !== strpos($charset, 'UTF-7') ) 59 67 die; 60 68 61 if ( function_exists('mb_convert_encoding') ) { // For international trackbacks 69 if ( function_exists('mb_convert_encoding') ) { // For international trackbacks. 62 70 $title = mb_convert_encoding($title, get_option('blog_charset'), $charset); 63 71 $excerpt = mb_convert_encoding($excerpt, get_option('blog_charset'), $charset); 64 72 $blog_name = mb_convert_encoding($blog_name, get_option('blog_charset'), $charset); 65 73 } 66 74 67 // Now that mb_convert_encoding() has been given a swing, we need to escape these three 75 // Now that mb_convert_encoding() has been given a swing, we need to escape these three. 68 76 $title = wp_slash($title); 69 77 $excerpt = wp_slash($excerpt); 70 78 $blog_name = wp_slash($blog_name); … … 76 84 trackback_response(1, 'I really need an ID for this to work.'); 77 85 78 86 if (empty($title) && empty($tb_url) && empty($blog_name)) { 79 // If it doesn't look like a trackback at all. ..87 // If it doesn't look like a trackback at all. 80 88 wp_redirect(get_permalink($tb_id)); 81 89 exit; 82 90 } … … 110 118 * Fires after a trackback is added to a post. 111 119 * 112 120 * @since 1.2.0 121 * 113 122 * @param int $trackback_id Trackback ID. 114 123 */ 115 124 do_action( 'trackback_post', $trackback_id );
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)