Changeset 25564
- Timestamp:
- 09/22/2013 06:38:56 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-trackback.php
r25273 r25564 1 1 <?php 2 2 /** 3 * Handle Trackbacks and Pingbacks sent to WordPress 3 * Handle Trackbacks and Pingbacks Sent to WordPress 4 * 5 * @since 0.71 4 6 * 5 7 * @package WordPress 8 * @subpackage Trackbacks 6 9 */ 7 10 … … 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 = '') { … … 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 … … 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']) : ''; … … 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 // For international trackbacks. 70 if ( function_exists('mb_convert_encoding') ) { 62 71 $title = mb_convert_encoding($title, get_option('blog_charset'), $charset); 63 72 $excerpt = mb_convert_encoding($excerpt, get_option('blog_charset'), $charset); … … 65 74 } 66 75 67 // Now that mb_convert_encoding() has been given a swing, we need to escape these three 76 // Now that mb_convert_encoding() has been given a swing, we need to escape these three. 68 77 $title = wp_slash($title); 69 78 $excerpt = wp_slash($excerpt); … … 77 86 78 87 if (empty($title) && empty($tb_url) && empty($blog_name)) { 79 // If it doesn't look like a trackback at all. ..88 // If it doesn't look like a trackback at all. 80 89 wp_redirect(get_permalink($tb_id)); 81 90 exit; … … 111 120 * 112 121 * @since 1.2.0 122 * 113 123 * @param int $trackback_id Trackback ID. 114 124 */
Note: See TracChangeset
for help on using the changeset viewer.