Only in b: wp-config.php
diff -ur a/wp-config-sample.php b/wp-config-sample.php
a
|
b
|
|
88 | 88 | |
89 | 89 | /** Sets up WordPress vars and included files. */ |
90 | 90 | require_once(ABSPATH . 'wp-settings.php'); |
| 91 | |
| 92 | /** |
| 93 | * A space separated list of IP addresses used for finding the ip of the remote, instead of your proxy/balancer. |
| 94 | * Any of these addresses will be replaced with the HTTP_X_FORWARDED_FOR header value if present, which a properly |
| 95 | * configured proxy should set. Set to blank to disable. |
| 96 | */ |
| 97 | define('PROXY_IP', ''); |
| 98 | |
diff -ur a/wp-includes/comment.php b/wp-includes/comment.php
a
|
b
|
|
1703 | 1703 | $parent_status = ( 0 < $commentdata['comment_parent'] ) ? wp_get_comment_status($commentdata['comment_parent']) : ''; |
1704 | 1704 | $commentdata['comment_parent'] = ( 'approved' == $parent_status || 'unapproved' == $parent_status ) ? $commentdata['comment_parent'] : 0; |
1705 | 1705 | |
1706 | | $commentdata['comment_author_IP'] = preg_replace( '/[^0-9a-fA-F:., ]/', '',$_SERVER['REMOTE_ADDR'] ); |
| 1706 | $commentdata['comment_author_IP'] = preg_replace( '/[^0-9a-fA-F:., ]/', '', get_remote_ip() ); |
1707 | 1707 | $commentdata['comment_agent'] = isset( $_SERVER['HTTP_USER_AGENT'] ) ? substr( $_SERVER['HTTP_USER_AGENT'], 0, 254 ) : ''; |
1708 | 1708 | |
1709 | 1709 | $commentdata['comment_date'] = current_time('mysql'); |
diff -ur a/wp-includes/functions.php b/wp-includes/functions.php
a
|
b
|
|
4191 | 4191 | function reset_mbstring_encoding() { |
4192 | 4192 | mbstring_binary_safe_encoding( true ); |
4193 | 4193 | } |
| 4194 | |
| 4195 | |
| 4196 | /** |
| 4197 | * Return the real client address if the REMOTE_ADDR we see here is known to be our proxy. |
| 4198 | */ |
| 4199 | function get_remote_ip() { |
| 4200 | if ( defined('PROXY_IP') |
| 4201 | && strpos( PROXY_IP, $_SERVER['REMOTE_ADDR'] ) !== false |
| 4202 | && $_SERVER['HTTP_X_FORWARDED_FOR'] != null |
| 4203 | && ! empty( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) { |
| 4204 | return $_SERVER['HTTP_X_FORWARDED_FOR']; |
| 4205 | }else{ |
| 4206 | return $_SERVER['REMOTE_ADDR']; |
| 4207 | } |
| 4208 | } |
| 4209 | |