diff --git a/wp-includes/functions-post.php b/wp-includes/functions-post.php index 2731befd0470..5f362d5f988b 100644 --- a/wp-includes/functions-post.php +++ b/wp-includes/functions-post.php @@ -541,7 +541,8 @@ function do_trackbacks($post_id) { $post = $wpdb->get_row("SELECT * FROM $wpdb->posts WHERE ID = $post_id"); $to_ping = get_to_ping($post_id); $pinged = get_pung($post_id); - + if ( empty($to_ping) ) + return; if (empty($post->post_excerpt)) $excerpt = apply_filters('the_content', $post->post_content); else @@ -591,7 +592,7 @@ function get_to_ping($post_id) { // Get any URIs in the todo list global $wpdb; $to_ping = $wpdb->get_var("SELECT to_ping FROM $wpdb->posts WHERE ID = $post_id"); $to_ping = trim($to_ping); - $to_ping = preg_split('/\s/', $to_ping); + $to_ping = preg_split('/\s/', $to_ping, -1, PREG_SPLIT_NO_EMPTY); return $to_ping; } diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 012b04877c5e..722f23e1d474 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -633,6 +633,10 @@ function generic_ping($post_id = 0) { // Send a Trackback function trackback($trackback_url, $title, $excerpt, $ID) { global $wpdb, $wp_version; + + if (empty($trackback_url)) + return; + $title = urlencode($title); $excerpt = urlencode($excerpt); $blog_name = urlencode(get_settings('blogname')); @@ -791,7 +795,7 @@ function do_enclose( $content, $post_ID ) { function wp_get_http_headers( $url ) { set_time_limit( 60 ); $parts = parse_url( $url ); - $file = $parts['path'] . $parts['query']; + $file = $parts['path'] . ($parts['query'] ? '?'.$parts['query'] : ''); $host = $parts['host']; if ( !isset( $parts['port'] ) ) $parts['port'] = 80;