#3052 closed defect (bug) (invalid)
pingback_ping() function displays wrong content in pingback-display in some occurances
Reported by: | webrocker | Owned by: | josephscott |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 2.0.4 |
Component: | Pings/Trackbacks | Keywords: | needs-patch needs-testing |
Focuses: | Cc: |
Description
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 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.
Attachments (3)
Change History (30)
#1
@
18 years ago
- Component changed from Administration to XML-RPC
- Keywords pingback|xmlrpc.php|has added; pingback xmlrpc.php has removed
#3
@
18 years ago
- Keywords reporter-feedback|pingback|xmlrpc.php|has added; pingback|xmlrpc.php|has removed
hm. the problem re-occured in my blog today, despite my "fix".
I use permalinks with "pathinfo", i.e.http:/mydomain.tld/myblog/index.php/2006/08/12/my-title/
A post with a nearly identical title ("brave new internet revisited") to the pinged post ("brave new internet") produced a pingback with again the wrong contents in it; again the "related posts" navigation showed up as the excerpt in the pingback display.
#4
@
18 years ago
ok, actually I have to deal with 2 different "bugs".
the first is kind-of template related:
1) with the original xmlrpc.php
, page-navigation- and meta-link-contents will show up as excerpt in the pingback, if they are wrapped inside <div></div>
tags and not <p></p>
tags. This can be fixed by adding div to the regex in line 1192 of the pingback_ping() function as stated above.
the second is caused by the use of the ultimate tag warrior plugin:
2) if it is used to display "related posts", and the pinging post has the same tags as the pinged post, the link to the pinged post will appear inside this "related posts" navigation - and the first appearance of that link will trigger the "excerpt" of the pingback. since the "related posts" navigation can appear anywhere inside the page, depending on the template, there is no way to tell which instance of the link is the "correct" one to use for the pingback excerpt. :-(
2) will only happen with pingbacks inside the same blog, 1) happens to "foreign" pingbacks as well, so I think 1) should be treated as a bug and 2)... hm, well, dunno.
#5
@
18 years ago
I have no idea how to do this, but wouldn't it be possible to tell the pingback_ping function to "look" inside the main-content area instead of "looking" through the whole document? or the other way round, to exclude the navigation/sidebar area?
#6
@
18 years ago
- Keywords pingback|xmlrpc.php|has added; reporter-feedback|pingback|xmlrpc.php|has removed
webrocker, if you have a fix please attach it as a patch.
#7
@
18 years ago
- Keywords patch|2nd opinion added; fix removed
patch attached, now that I kind of know how to use svn ;-)
#10
@
17 years ago
- Keywords pingback xmlrpc.php has-patch 2nd-opinion added; pingback|xmlrpc.php|has patch|2nd opinion removed
- Milestone changed from 2.2 to 2.3
#14
@
15 years ago
- Resolution set to wontfix
- Status changed from new to closed
this has been rotting for long enough
#16
@
15 years ago
- Keywords needs-review added; 2nd-opinion removed
- Milestone set to 2.9
- Resolution wontfix deleted
- Status changed from closed to reopened
refreshed the patch, in case there is any interest in this release
#17
@
15 years ago
- Owner changed from anonymous to josephscott
- Status changed from reopened to assigned
#19
@
15 years ago
- Keywords tested added; needs-review removed
I see no problem in hotfixing this issue - the overall implementation seems to have bolder design deficiencies anyway so that this patch shouldn't make a difference in terms of breaking things. looks pretty ok to me, tested OK, patch still applies clean.
#22
@
14 years ago
- Keywords close added; pingback xmlrpc.php tested removed
- Milestone changed from 3.0 to Future Release
#23
@
10 years ago
- Keywords needs-patch added; has-patch removed
Unsure what to do with this ticket. Fix looks easy but not touched for years. Fine with closing.
#24
@
9 years ago
- Keywords needs-testing added; close removed
Is this still an issue? If so, let's get it fixed.
#25
@
8 years ago
- Component changed from XML-RPC to Pings/Trackbacks
- Resolution set to invalid
- Status changed from reviewing to closed
Suggesting that the code for generating the excerpt itself should be refreshed, and I'm suggesting this be closed in favor of a refresh on that.
The code on this would also need to be refreshed due changes in the function.
#27
@
5 weeks ago
Are you encountering issues with the pingback_ping()
function in WordPress, where it displays incorrect content in pingback notifications under certain circumstances? Would you like assistance in implementing the suggested fix to address this issue by modifying the regular expression pattern in the xmlrpc.php
file?
sorry, i messed the formatting in the orig post... should read:
(...) 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. (...)