[wp-trac] [WordPress Trac] #38818: REST API: Support ipv6 for `author_ip` in comments endpoint

WordPress Trac noreply at wordpress.org
Thu Nov 17 00:31:01 UTC 2016


#38818: REST API: Support ipv6 for `author_ip` in comments endpoint
-------------------------------------------------+-------------------------
 Reporter:  dd32                                 |       Owner:
     Type:  defect (bug)                         |      Status:  new
 Priority:  normal                               |   Milestone:  4.7
Component:  Comments                             |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch has-unit-tests needs-      |     Focuses:  rest-api
  testing needs-refresh                          |
-------------------------------------------------+-------------------------

Comment (by dd32):

 FWIW I don't see the need to to allow validation of only-ipv4, having it
 just specify `ip` and checking it's a valid IP seems the best way forward
 to me. If we can internally map `ipv4` to a generic `ip` check that seems
 even better.

 The 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' ]`.

 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.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/38818#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list