[wp-trac] [WordPress Trac] #34538: Improvement of the IPv4 address format check

WordPress Trac noreply at wordpress.org
Sun Nov 1 17:19:02 UTC 2015


#34538: Improvement of the IPv4 address format check
----------------------------------------+------------------------------
 Reporter:  ka2                         |       Owner:
     Type:  enhancement                 |      Status:  new
 Priority:  normal                      |   Milestone:  Awaiting Review
Component:  HTTP API                    |     Version:  trunk
 Severity:  normal                      |  Resolution:
 Keywords:  has-patch needs-unit-tests  |     Focuses:
----------------------------------------+------------------------------

Comment (by swissspidy):

 [attachment:34538.patch] still includes unneeded whitespace changes.

 > This method doesn't validate an IP address, it just checks whether the
 passed value looks like an IP address as opposed to a domain name.

 Agree on this, though the second regex seems to check for real IPv6
 addresses. See http://home.deds.nl/~aeron/regex/

 >If an invalid IP address is passed to an HTTP request, then
 `WP_Http::is_ip_address()` must still return true otherwise the host will
 incorrectly be treated as a domain name. Note that either way, the HTTP
 request will fail due to the invalid IP address.

 What exactly would change for an HTTP request with this proposed patch?

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


More information about the wp-trac mailing list