REST API: Change “ipv4” types to “ip” to support ipv6.

Stop presuming IP address are IPv4, instead make the type “ip” to be agnostic of IP version. This fixes requests with ipv6 addresses for comments in core.

Props dd32, schlessera, danielbachhuber.
Fixes #38818.

git-svn-id: https://develop.svn.wordpress.org/trunk@39296 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Joe Hoyle
2016-11-18 19:32:03 +00:00
parent db07183b6f
commit ba5a196d9e
4 changed files with 41 additions and 14 deletions
@@ -1115,7 +1115,7 @@ class WP_REST_Comments_Controller extends WP_REST_Controller {
'author_ip' => array(
'description' => __( 'IP address for the object author.' ),
'type' => 'string',
'format' => 'ipv4',
'format' => 'ip',
'context' => array( 'edit' ),
'default' => '127.0.0.1',
),