Skip to content

Commit

Permalink
Don't attempt to trackback an empty string. Fix file path in wp_get_h…
Browse files Browse the repository at this point in the history
…ttp_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
  • Loading branch information
ryan committed May 18, 2005
1 parent ec0f80a commit 9e63b5c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 3 additions & 2 deletions wp-includes/functions-post.php
Expand Up @@ -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
Expand Down Expand Up @@ -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;
}

Expand Down
6 changes: 5 additions & 1 deletion wp-includes/functions.php
Expand Up @@ -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'));
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 9e63b5c

Please sign in to comment.