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

WordPress Trac noreply at wordpress.org
Wed Nov 16 17:58:08 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                          |
-------------------------------------------------+-------------------------
Changes (by swissspidy):

 * keywords:  has-patch has-unit-tests needs-testing => has-patch has-unit-
     tests needs-testing needs-refresh


Comment:

 > I agree that all code should ideally support both. However, getting rid
 of the schema type `ipv4` in favor of `ip` might break existing code that
 already relies on the schema type `ipv4`.

 What about automatically mapping `ipv4` to `ip`? Only checking IPv4
 addresses doesn't make sense, but if the `ipv4` is to be kept and one
 really needs to only validate IPv4, we could also add a new parameter to
 `rest_is_ip_address()`.

 Patch needs to be updated anyway. We can't use `filter_var()` as the
 filter extension can be disabled on older PHP versions.

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


More information about the wp-trac mailing list