Make WordPress Core

Changeset 6668


Ignore:
Timestamp:
01/26/2008 10:18:33 AM (19 years ago)
Author:
westi
Message:

Remove the duplicate code for sanitising IP Addresses we only need to do it once. Fixes #4579.

File:
1 edited

Legend:

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

    r6658 r6668  
    553553
    554554        if ( ! isset($comment_author_IP) )
    555                 $comment_author_IP = preg_replace( '/[^0-9a-fA-F:., ]/', '',$_SERVER['REMOTE_ADDR'] );
     555                $comment_author_IP = '';
    556556        if ( ! isset($comment_date) )
    557557                $comment_date = current_time('mysql');
     
    651651        $commentdata['user_ID']         = (int) $commentdata['user_ID'];
    652652
    653         $commentdata['comment_author_IP'] = preg_replace( '/[^0-9., ]/', '',$_SERVER['REMOTE_ADDR'] );
     653        $commentdata['comment_author_IP'] = preg_replace( '/[^0-9a-fA-F:., ]/', '',$_SERVER['REMOTE_ADDR'] );
    654654        $commentdata['comment_agent']     = $_SERVER['HTTP_USER_AGENT'];
    655655
Note: See TracChangeset for help on using the changeset viewer.