WordPress.org

Make WordPress Core

Opened 12 years ago

Closed 12 years ago

#7844 closed defect (bug) (fixed)

WP sends url-encoded text in pingback/trackback

Reported by: reinkim Owned by:
Milestone: 2.7 Priority: normal
Severity: major Version: 2.7
Component: General Keywords: has-patch
Focuses: Cc:

Description

From [9012], WP sends trackback/pingback using urlencoded text.

[9012] introduces HTTP api to send trackback/pingback. But in this changeset, WP sends blog-title, uri and excerpt in url-encoded format.
So pinged/trackbacked blog displays some strangely formatted trackback like,

blog+title // title
http%3A%2F%2Fexample.org%2F111 // uri
blah+blah+blah+%23%21%40%23%24 // excerpt

This behavior is caused by passing arguments of HTTP api in urlencoded text. (wp-includes/comment.php:1312)

To fix this problem, I've patched current working version of trunk like following diff.

  • comment.php

     
    13101310   $options = array();
    13111311   $options['timeout'] = 4;
    13121312   $options['body'] = array(
    1313        'title' => urlencode($title),
    1314        'url' => urlencode(get_permalink($ID)),
    1315        'blog_name' => urlencode(get_option('blogname')),
    1316        'excerpt' => urlencode($excerpt)
     1313       'title' => $title,
     1314       'url' => get_permalink($ID),
     1315       'blog_name' => get_option('blogname'),
     1316       'excerpt' => $excerpt
    13171317   );

Attachments (1)

trackback.patch (636 bytes) - added by reinkim 12 years ago.
Patch for wp-includes/comments.php

Download all attachments as: .zip

Change History (6)

#1 @reinkim
12 years ago

  • Keywords trackback pingback HTTP api removed

#2 @reinkim
12 years ago

  • Summary changed from WP sends urlencode text in pingback/trackback to WP sends url-encoded text in pingback/trackback

@reinkim
12 years ago

Patch for wp-includes/comments.php

#3 @reinkim
12 years ago

  • Keywords has-patch added

#4 @ryan
12 years ago

WP_Http::request() calls http_build_query() to encode the request so your patch looks correct.

#5 @ryan
12 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [9292]) Don't double encode ping/trackbacks. Props reinkim. fixes #7844

Note: See TracTickets for help on using tickets.