Ticket #9235: wp_remote_ip.diff
File wp_remote_ip.diff, 1.4 KB (added by , 13 years ago) |
---|
-
wp-includes/comment.php
1247 1247 $parent_status = ( 0 < $commentdata['comment_parent'] ) ? wp_get_comment_status($commentdata['comment_parent']) : ''; 1248 1248 $commentdata['comment_parent'] = ( 'approved' == $parent_status || 'unapproved' == $parent_status ) ? $commentdata['comment_parent'] : 0; 1249 1249 1250 $commentdata['comment_author_IP'] = preg_replace( '/[^0-9a-fA-F:., ]/', '',$_SERVER['REMOTE_ADDR']);1250 $commentdata['comment_author_IP'] = wp_remote_ip(); 1251 1251 $commentdata['comment_agent'] = substr($_SERVER['HTTP_USER_AGENT'], 0, 254); 1252 1252 1253 1253 $commentdata['comment_date'] = current_time('mysql'); -
wp-includes/functions.php
1302 1302 } 1303 1303 1304 1304 /** 1305 * Retrieve the IP address of the user 1306 * 1307 * @since 3.0.0 1308 * 1309 * @return string 1310 */ 1311 function wp_remote_ip() { 1312 return apply_filters('get_ip', preg_replace('/[^0-9a-fA-F:., ]/', '', $_SERVER['REMOTE_ADDR'])); 1313 } 1314 1315 /** 1305 1316 * Whether today is a new day. 1306 1317 * 1307 1318 * @since 0.71 … … 4037 4048 function _search_terms_tidy($t) { 4038 4049 return trim($t, "\"'\n\r "); 4039 4050 } 4040 ?> 4041 No newline at end of file 4051 ?>