Make WordPress Core

Opened 5 years ago

Last modified 5 months ago

#14601 closed enhancement

wp_new_comment method doesn't allow passed in values for IP and user-agent — at Initial Version

Reported by: mrutz Owned by:
Milestone: 4.3 Priority: normal
Severity: normal Version: 3.0.1
Component: Comments Keywords: rest-api has-patch
Focuses: Cc:


In a scenario where you have a client that receives comments from the internet and pre-processes those comments before feeding them into wordpress through xmlrpc the ip and user-agent of the commenting internet user gets lost because there is no way of passing those values into the wp_new_comment function.

$_SERVERREMOTE_ADDR? and $_SERVERHTTP_USER_AGENT? are hard-coded, which in the above mentioned scenario will always have the IP and user-agent from the client that feeds the comments into wp through xmlrpc.

The attached patch will used passed in values and only fall back to $_SERVERREMOTE_ADDR? and $_SERVERHTTP_USER_AGENT? if not passed in.

Change History (1)

Note: See TracTickets for help on using tickets.