WordPress.org

Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #38818, comment 5


Ignore:
Timestamp:
11/17/2016 12:32:04 AM (3 years ago)
Author:
dd32
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #38818, comment 5

    initial v1  
    33The only reason I would want a specific IPv4 validator is if the json schema spec followed doesn't allow a generic `ip` specification and wanted it to be specified as `[ 'ipv4', 'ipv6' ]`.
    44
    5 As for validating IPv6 addresses, that's a super-complex regex AFAIK, we may be able to borrow/call/re-use something from `src/wp-includes/Requests/IPv6.php` / `src/wp-includes/SimplePie/Net/IPv6.php` though.
     5As for validating IPv6 addresses, that's a super-complex regex AFAIK, we may be able to borrow/call/re-use something from `src/wp-includes/Requests/IPv6.php` / `src/wp-includes/SimplePie/Net/IPv6.php` though (I wouldn't worry too much about requiring the IPv6 address is strictly valid though, I'd put the onus on the caller, a simple basic syntax check may be okay here)