Make WordPress Core


Ignore:
Timestamp:
07/06/2006 12:04:24 AM (19 years ago)
Author:
matt
Message:

Clean up how we address IP addresses throughout the code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/comment.php

    r3985 r3990  
    322322
    323323    if ( ! isset($comment_author_IP) )
    324         $comment_author_IP = $_SERVER['REMOTE_ADDR'];
     324        $comment_author_IP = preg_replace( '/[^0-9., ]/', '',$_SERVER['REMOTE_ADDR'] );
    325325    if ( ! isset($comment_date) )
    326326        $comment_date = current_time('mysql');
     
    366366    $commentdata['user_ID']         = (int) $commentdata['user_ID'];
    367367
    368     $commentdata['comment_author_IP'] = $_SERVER['REMOTE_ADDR'];
     368    $commentdata['comment_author_IP'] = preg_replace( '/[^0-9., ]/', '',$_SERVER['REMOTE_ADDR'] );
    369369    $commentdata['comment_agent']     = $_SERVER['HTTP_USER_AGENT'];
    370370
Note: See TracChangeset for help on using the changeset viewer.