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: http://svn.automattic.com/wordpress/trunk@2612 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2005-05-18 03:17:55 +00:00
parent ec0f80aa43
commit 9e63b5c8d8
2 changed files with 8 additions and 3 deletions

View File

@ -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;
}

View File

@ -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;