[buddypress-trac] [BuddyPress Trac] #6594: Add "X-akismet-pro-tip" support to Activity Akismet integration
buddypress-trac
noreply at wordpress.org
Sun Mar 25 03:32:43 UTC 2018
#6594: Add "X-akismet-pro-tip" support to Activity Akismet integration
----------------------------------------+-----------------------
Reporter: Paul Gibbs | Owner: djpaul
Type: enhancement | Status: reopened
Priority: normal | Milestone: 3.0
Component: Activity | Version:
Severity: normal | Resolution:
Keywords: needs-patch good-first-bug |
----------------------------------------+-----------------------
Comment (by r-a-y):
> Can I have the log or the backtrack please? Ta.
What specifically do you need a log of?
If it is for `$response = Akismet::http_post( $query_string, $path );`
Here's what I get:
{{{
Array
(
[0] => Requests_Utility_CaseInsensitiveDictionary Object
(
[data:protected] => Array
(
[server] => nginx
[date] => Sun, 25 Mar 2018 01:43:19 GMT
[content-type] => text/plain; charset=utf-8
[content-length] => 5
[x-akismet-guid] => XXX
)
)
[1] => false
)
}}}
After some more debugging, I've found that this line is the cause of the
hang-up:
`$activity_data['bp_as_result_headers'] = $response[0];`
Once I comment this line out, the activity update is able to post
normally.
Since `$response[0]` is an instance of the
`Requests_Utility_CaseInsensitiveDictionary` class, I tried using the
[https://github.com/WordPress/WordPress/blob/4.9-branch/wp-
includes/Requests/Utility/CaseInsensitiveDictionary.php#L95 getAll()]
method to fetch the headers:
`$activity_data['bp_as_result_headers'] = $response[0]->getAll();`
But, this also causes the infinite loop. I'm not too familiar with the
Akismet API, so I'm not sure how to set the headers properly.
Hope that helps somewhat. Let me know if you need anything else from me.
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/6594#comment:10>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac
More information about the buddypress-trac
mailing list