[wp-trac] Re: [WordPress Trac] #3331: Interoperability -- Trackback does not work with MSN Spaces

WordPress Trac wp-trac at lists.automattic.com
Mon Nov 6 05:58:58 GMT 2006


#3331: Interoperability -- Trackback does not work with MSN Spaces
---------------------------+------------------------------------------------
 Reporter:  nobrain2000    |        Owner:  anonymous
     Type:  defect         |       Status:  new      
 Priority:  normal         |    Milestone:           
Component:  XML-RPC        |      Version:  2.0.4    
 Severity:  normal         |   Resolution:           
 Keywords:  MSN trackback  |  
---------------------------+------------------------------------------------
Old description:

> If you have MSN Space ping a permanent link of a WP blog, the ping is
> ignored by WP. The other way (WP ping MSN Space permanent link) works
> fine.
>
> I did some investigation of this problem. There are two problems that
> prevents WP from processing trackback pings from MSN.
>
> 1. MSN does not seem to conform to the trackback protocol. Specifically,
> it does not POST the title field, which is required by WordPress. While
> does sounds like an MSN Space problem, the embarassing fact is that all
> other blogging software, including Typepad and MT, works with MSN just
> fine.
>
> Below is my workaround:
>
> In wp-trackback.php, add the following:
> <pre>
> if(empty($title)){
>     $title=$excerpt;
>     if(preg_match("/spaces\.live\.com/i",$tb_url))
>     {
>       $excerpt="";
>
>     }
> }
> if(empty($title)) $title="No title";
> </pre>
>
> Now that you added the above code, you will see the trackback entry in
> your blog, but the URL (to the MSN Space permanent link) is wrong. This
> is because of the second problem. See below:
>
> 2. WP removes all the !'s in URLs, and MSN permanent link URLs have !'s
> in them.
>
> I worked around this by chainging clean_url() in comment-functions.php so
> that it does not remove ! from URLs. Below is the code:
>
> <pre>
> function clean_url( $url ) {
>    if ('' == $url) return $url;
>    #note ! is added to the regexp below.
>    $url = preg_replace('|[^a-z0-9-~+_.?#=!&;,/:]|i', '', $url);
>    $url = str_replace(';//', '://', $url);
>    $url = (!strstr($url, '://')) ? 'http://'.$url : $url;
>    $url = preg_replace('/&([^#])(?![a-z]{2,8};)/', '&$1', $url);
>    return $url;
> }
> </pre>

New description:

 If you have MSN Space ping a permanent link of a WP blog, the ping is
 ignored by WP. The other way (WP ping MSN Space permanent link) works
 fine.

 I did some investigation of this problem. There are two problems that
 prevents WP from processing trackback pings from MSN.

 1. MSN does not seem to conform to the trackback protocol. Specifically,
 it does not POST the title field, which is required by WordPress. While
 does sounds like an MSN Space problem, the embarassing fact is that all
 other blogging software, including Typepad and MT, works with MSN just
 fine.

 Below is my workaround:

 In wp-trackback.php, add the following:

 {{{
 if(empty($title)){
     $title=$excerpt;
     if(preg_match("/spaces\.live\.com/i",$tb_url))
     {
       $excerpt="";

     }
 }
 if(empty($title)) $title="No title";
 }}}

 Now that you added the above code, you will see the trackback entry in
 your blog, but the URL (to the MSN Space permanent link) is wrong. This is
 because of the second problem. See below:

 2. WP removes all the !'s in URLs, and MSN permanent link URLs have !'s in
 them.

 I worked around this by chainging clean_url() in comment-functions.php so
 that it does not remove ! from URLs. Below is the code:

 {{{
 function clean_url( $url ) {
    if ('' == $url) return $url;
    #note ! is added to the regexp below.
    $url = preg_replace('|[^a-z0-9-~+_.?#=!&;,/:]|i', '', $url);
    $url = str_replace(';//', '://', $url);
    $url = (!strstr($url, '://')) ? 'http://'.$url : $url;
    $url = preg_replace('/&([^#])(?![a-z]{2,8};)/', '&$1', $url);
    return $url;
 }
 }}}

Comment (by markjaquith):

 Just updating the code wrapping to work with WikiFormatting

-- 
Ticket URL: <http://trac.wordpress.org/ticket/3331#comment:1>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list