[wp-trac] [WordPress Trac] #14601: wp_new_comment method doesn't allow passed in values for IP and user-agent

WordPress Trac noreply at wordpress.org
Sat May 4 12:03:03 UTC 2013


#14601: wp_new_comment method doesn't allow passed in values for IP and user-agent
---------------------------------+--------------------
 Reporter:  mrutz                |       Owner:
     Type:  enhancement          |      Status:  new
 Priority:  normal               |   Milestone:  3.6
Component:  Comments             |     Version:  3.0.1
 Severity:  normal               |  Resolution:
 Keywords:  has-patch 3.2-early  |
---------------------------------+--------------------
Description changed by ocean90:

Old description:

> 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.
>
> $_SERVER['REMOTE_ADDR'] and $_SERVER['HTTP_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
> $_SERVER['REMOTE_ADDR'] and $_SERVER['HTTP_USER_AGENT'] if not passed in.

New description:

 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.

 `$_SERVER['REMOTE_ADDR']` and `$_SERVER['HTTP_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
 `$_SERVER['REMOTE_ADDR']` and `$_SERVER['HTTP_USER_AGENT']` if not passed
 in.

--

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/14601#comment:9>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list