Ticket #17560: 17560.3.diff
| File 17560.3.diff, 1.8 KB (added by , 15 years ago) |
|---|
-
wp-includes/formatting.php
3000 3000 return apply_filters( 'sanitize_mime_type', $sani_mime_type, $mime_type ); 3001 3001 } 3002 3002 3003 /** 3004 * Sanitize space or carriage return separated URLs that are used to send trackbacks. 3005 * 3006 * @since 3.3.0 3007 * 3008 * @param string $to_ping Space or carriage return separated URLs 3009 * @return string URLs starting with the http or https protocol, separated by a carriage return. 3010 */ 3011 function sanitize_trackback_urls( $to_ping ) { 3012 $urls_to_ping = preg_split( '/\s/', trim( $to_ping ), -1, PREG_SPLIT_NO_EMPTY ); 3013 foreach( $urls_to_ping as $k => $url ) { 3014 if ( !preg_match( '#^https?://.#i', $url ) ) 3015 unset( $urls_to_ping[$k] ); 3016 } 3017 $urls_to_ping = implode( "\n", $urls_to_ping ); 3018 return apply_filters( 'sanitize_trackback_urls', $urls_to_ping, $to_ping ); 3019 } 3020 3003 3021 ?> -
wp-includes/post.php
2530 2530 $ping_status = get_option('default_ping_status'); 2531 2531 2532 2532 if ( isset($to_ping) ) 2533 $to_ping = preg_replace('|\s+|', "\n", $to_ping);2533 $to_ping = sanitize_trackback_urls( $to_ping ); 2534 2534 else 2535 2535 $to_ping = ''; 2536 2536 … … 3057 3057 function get_to_ping($post_id) { 3058 3058 global $wpdb; 3059 3059 $to_ping = $wpdb->get_var( $wpdb->prepare( "SELECT to_ping FROM $wpdb->posts WHERE ID = %d", $post_id )); 3060 $to_ping = trim($to_ping);3060 $to_ping = sanitize_trackback_urls( $to_ping ); 3061 3061 $to_ping = preg_split('/\s/', $to_ping, -1, PREG_SPLIT_NO_EMPTY); 3062 3062 $to_ping = apply_filters('get_to_ping', $to_ping); 3063 3063 return $to_ping;