#34141 closed enhancement (fixed)
Allow Plugins Access to Pingback Source HTML
Reported by: | dshanske | Owned by: | SergeyBiryukov |
---|---|---|---|
Milestone: | 4.5 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Pings/Trackbacks | Keywords: | has-patch commit 4.5-early |
Focuses: | Cc: |
Description
This came up as I was looking at trying to close #3491.
This is a 9 year old ticket that proposes that hooks be added to allow plugins access to trackback and pingback data.
@markjaquith had pointed out that the best solution is to use the preprocess comment hook, but this doesn't allow the data to be saved into the comment.
The simplest solution is to modify wp_insert_comment to save anything not in an existing field into comment meta and then modify pingbacks and trackbacks to save that data into the meta.
Attachments (5)
Change History (33)
#1
@
9 years ago
- Keywords 2nd-opinion needs-patch added
- Summary changed from Allow Plugins Access to Pingback and Trackback Data to Allow Plugins Access to Pingback Data
#2
@
9 years ago
The diff I added uses the easier option of passing the entire $commentdata to the comment_post hook. This would allow any plugin to get access to the data.
#4
@
9 years ago
Added the second option for implementation that takes anything in $commentdata that isn't a standard field and saves it in meta.
This ticket was mentioned in Slack in #core by dshanske. View the logs.
9 years ago
#7
@
9 years ago
There was concern expressed in Slack that allowing the stored HTML to be stored could be a security issue. However, looking at the pingback code, it strips all tags. Assuming it must predate wp_kses_post which strips only certain tags, but that was before my time.
Think this needs to be addressed as well, as currently, it occurs to me the concern is somewhat moot as all tags have already been stripped except links before it is saved...but on the other hand, that would strip any other type of markup if a plugin wanted to use it...
The best way to address that part of it may be to close this ticket by coming up with the code to pass the data, and address the presentation issue on the opened #32653.
This ticket was mentioned in Slack in #core by dshanske. View the logs.
9 years ago
#9
@
9 years ago
- Summary changed from Allow Plugins Access to Pingback Data to Allow Plugins Access to Pingback Source HTML
This ticket was mentioned in Slack in #core by dshanske. View the logs.
9 years ago
This ticket was mentioned in Slack in #core by wonderboymusic. View the logs.
9 years ago
#18
follow-up:
↓ 22
@
9 years ago
- Keywords commit 4.5-early added; 2nd-opinion removed
I think 34141.diff would be the preferred approach here.
In 34141.3.diff:
- Rename
$linea
to$remote_source
for clarity. - Add
'remote_source'
to comment data, so it's available to the'preprocess_comment'
filter. - Pass comment data to the
'comment_post'
filter.
This ticket was mentioned in Slack in #core by dshanske. View the logs.
9 years ago
This ticket was mentioned in Slack in #core by dshanske. View the logs.
9 years ago
#22
in reply to:
↑ 18
@
9 years ago
Replying to SergeyBiryukov:
I think 34141.diff would be the preferred approach here.
In 34141.3.diff:
- Rename
$linea
to$remote_source
for clarity.- Add
'remote_source'
to comment data, so it's available to the'preprocess_comment'
filter.- Pass comment data to the
'comment_post'
filter.
This looks like a sane solution to me.
I don't think we should auto-persist the remote-source but making it available for plugins to use seems like a reasonable idea.
#23
follow-up:
↓ 24
@
9 years ago
The only change I was thinking of proposing was that it should be the raw, not the completely altered remote source passed in. The point of resolving this update to a nine year old issue is that a plugin could offer a pingback that is less useless in its display than the default.
#24
in reply to:
↑ 23
@
9 years ago
Replying to dshanske:
The only change I was thinking of proposing was that it should be the raw, not the completely altered remote source passed in. The point of resolving this update to a nine year old issue is that a plugin could offer a pingback that is less useless in its display than the default.
34141.4.diff stores the original response in $remote_source_original
and passes it to preprocess_comment
and comment_post
filters as well.
So, the scope of this proposal is as follows.