Changeset 19675
- Timestamp:
- 01/04/2012 07:45:13 PM (13 years ago)
- Location:
- trunk/wp-includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/formatting.php
r19601 r19675 3003 3003 } 3004 3004 3005 /** 3006 * Sanitize space or carriage return separated URLs that are used to send trackbacks. 3007 * 3008 * @since 3.4.0 3009 * 3010 * @param string $to_ping Space or carriage return separated URLs 3011 * @return string URLs starting with the http or https protocol, separated by a carriage return. 3012 */ 3013 function sanitize_trackback_urls( $to_ping ) { 3014 $urls_to_ping = preg_split( '/\r\n\t /', trim( $to_ping ), -1, PREG_SPLIT_NO_EMPTY ); 3015 foreach ( $urls_to_ping as $k => $url ) { 3016 if ( !preg_match( '#^https?://.#i', $url ) ) 3017 unset( $urls_to_ping[$k] ); 3018 } 3019 $urls_to_ping = array_map( 'esc_url_raw', $urls_to_ping ); 3020 $urls_to_ping = implode( "\n", $urls_to_ping ); 3021 return apply_filters( 'sanitize_trackback_urls', $urls_to_ping, $to_ping ); 3022 } 3023 3005 3024 ?> -
trunk/wp-includes/post.php
r19593 r19675 2538 2538 2539 2539 if ( isset($to_ping) ) 2540 $to_ping = preg_replace('|\s+|', "\n", $to_ping);2540 $to_ping = sanitize_trackback_urls( $to_ping ); 2541 2541 else 2542 2542 $to_ping = ''; … … 3065 3065 global $wpdb; 3066 3066 $to_ping = $wpdb->get_var( $wpdb->prepare( "SELECT to_ping FROM $wpdb->posts WHERE ID = %d", $post_id )); 3067 $to_ping = trim($to_ping);3067 $to_ping = sanitize_trackback_urls( $to_ping ); 3068 3068 $to_ping = preg_split('/\s/', $to_ping, -1, PREG_SPLIT_NO_EMPTY); 3069 3069 $to_ping = apply_filters('get_to_ping', $to_ping);
Note: See TracChangeset
for help on using the changeset viewer.