[wp-trac] [WordPress Trac] #3052: pingback_ping() function displays wrong content in pingback-display in some occurances

WordPress Trac wp-trac at lists.automattic.com
Sat Aug 19 13:41:53 GMT 2006


#3052: pingback_ping() function displays wrong content in pingback-display in some
occurances
----------------------------+-----------------------------------------------
 Reporter:  webrocker       |       Owner:  anonymous                    
     Type:  defect          |      Status:  new                          
 Priority:  normal          |   Milestone:                               
Component:  Administration  |     Version:  2.0.4                        
 Severity:  normal          |    Keywords:  pingback, xmlrpc.php, has fix
----------------------------+-----------------------------------------------
 If the blog uses a template where the post-meta-data like the trackback-
 link and such is wrapped in a "div" tag but not in a "p" tag, the pingback
 will incorrectly display the content surrounding the meta-data-links, not
 the content of the pinging post.
 if there is a "related posts" navigation on the page (possible with the
 [http://www.neato.co.nz/ultimate-tag-warrior/ ultimate-tag-warrior]
 plugin), or any other links inside the page that link to other posts from
 the same blog (even the ''next post'', ''previous post'' links), pingbacks
 will display the content around the first of these links, not the contents
 around the "pinging" link inside the post.

 '''Possible fix:'''
 on line 1192 in xmlrpc.php:
 {{{$linea = preg_replace( “/ <
 (h1|h2|h3|h4|h5|h6|p|th|td|li|dt|dd|pre|caption|input|textarea|button|body)[^>]*>/”,
 “\n\n”, $linea );}}}
 the "div" tag is not recognized.
 changing that to:
 {{{$linea = preg_replace( “/ <
 (h1|h2|h3|h4|h5|h6|p|th|td|li|dt|dd|pre|caption|input|textarea|button|body|div)[^>]*>/”,
 “\n\n”, $linea );}}}
 fixed the problems for my blog.
 Frankly I'm not that "deep" into regular expressions to fully understand
 what's going on inside the pingback_ping() function - but after inserting
 "div" to the line above my pingbacks display the correct excerpt of the
 pinging post, which they failed to do  before.

-- 
Ticket URL: <http://trac.wordpress.org/ticket/3052>
WordPress Trac <http://wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list