WordPress.org

Make WordPress Core

Changes between Version 2 and Version 3 of Ticket #43545, comment 34


Ignore:
Timestamp:
04/12/2018 11:37:33 AM (16 months ago)
Author:
birgire
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #43545, comment 34

    v2 v3  
    6767**To consider:**
    6868
    69 Check if IPv4 contains two adjacent dots {{{..}}}, then return {{{'0.0.0.0'}}}.
    70 
    7169Example:
    7270
     
    7775
    7876outputs: {{{'...0'}}} instead of {{{0.0.0.0}}}.
     77
     78Another example is how out-of-range IPv4 should be handled:
     79
     80{{{
     81echo wp_privacy_anonymize_data( 'ip', '999.999.999.999' );
     82 
     83}}}
     84
     85outputs: {{{'999.999.999.0'}}} but should it be instead {{{0.0.0.0}}} ?
     86
     87One might aim for a stricter IPv4 validation in a future ticket or e.g. ticket #34538 [https://core.trac.wordpress.org/ticket/34538 Improvement of the IPv4 address format check] on {{{WP_Http::is_ip_address}}}.
     88
     89I wonder if there should be a general WP IP utility (possible future ticket) to avoid IP handling duplications in various parts of the core (e.g. db hosts, HTTP API, Rest, Multisite support of IPv6, ... ).