Don't attempt to trackback an empty string. Fix file path in wp_get_http_headers(). This avoids 'File does not exist' server messages when processing enclosures.
git-svn-id: https://develop.svn.wordpress.org/trunk@2612 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
239462c326
commit
0edec9ae9e
|
@ -541,7 +541,8 @@ function do_trackbacks($post_id) {
|
||||||
$post = $wpdb->get_row("SELECT * FROM $wpdb->posts WHERE ID = $post_id");
|
$post = $wpdb->get_row("SELECT * FROM $wpdb->posts WHERE ID = $post_id");
|
||||||
$to_ping = get_to_ping($post_id);
|
$to_ping = get_to_ping($post_id);
|
||||||
$pinged = get_pung($post_id);
|
$pinged = get_pung($post_id);
|
||||||
|
if ( empty($to_ping) )
|
||||||
|
return;
|
||||||
if (empty($post->post_excerpt))
|
if (empty($post->post_excerpt))
|
||||||
$excerpt = apply_filters('the_content', $post->post_content);
|
$excerpt = apply_filters('the_content', $post->post_content);
|
||||||
else
|
else
|
||||||
|
@ -591,7 +592,7 @@ function get_to_ping($post_id) { // Get any URIs in the todo list
|
||||||
global $wpdb;
|
global $wpdb;
|
||||||
$to_ping = $wpdb->get_var("SELECT to_ping FROM $wpdb->posts WHERE ID = $post_id");
|
$to_ping = $wpdb->get_var("SELECT to_ping FROM $wpdb->posts WHERE ID = $post_id");
|
||||||
$to_ping = trim($to_ping);
|
$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;
|
return $to_ping;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -633,6 +633,10 @@ function generic_ping($post_id = 0) {
|
||||||
// Send a Trackback
|
// Send a Trackback
|
||||||
function trackback($trackback_url, $title, $excerpt, $ID) {
|
function trackback($trackback_url, $title, $excerpt, $ID) {
|
||||||
global $wpdb, $wp_version;
|
global $wpdb, $wp_version;
|
||||||
|
|
||||||
|
if (empty($trackback_url))
|
||||||
|
return;
|
||||||
|
|
||||||
$title = urlencode($title);
|
$title = urlencode($title);
|
||||||
$excerpt = urlencode($excerpt);
|
$excerpt = urlencode($excerpt);
|
||||||
$blog_name = urlencode(get_settings('blogname'));
|
$blog_name = urlencode(get_settings('blogname'));
|
||||||
|
@ -791,7 +795,7 @@ function do_enclose( $content, $post_ID ) {
|
||||||
function wp_get_http_headers( $url ) {
|
function wp_get_http_headers( $url ) {
|
||||||
set_time_limit( 60 );
|
set_time_limit( 60 );
|
||||||
$parts = parse_url( $url );
|
$parts = parse_url( $url );
|
||||||
$file = $parts['path'] . $parts['query'];
|
$file = $parts['path'] . ($parts['query'] ? '?'.$parts['query'] : '');
|
||||||
$host = $parts['host'];
|
$host = $parts['host'];
|
||||||
if ( !isset( $parts['port'] ) )
|
if ( !isset( $parts['port'] ) )
|
||||||
$parts['port'] = 80;
|
$parts['port'] = 80;
|
||||||
|
|
Loading…
Reference in New Issue