mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-22 15:31:42 +01:00
HTTP: Improve detection of valid IP addresses.
Merge of [37115] to the 4.4 branch. Built from https://develop.svn.wordpress.org/branches/4.4@37116 git-svn-id: http://core.svn.wordpress.org/branches/4.4@37083 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
4d66a3b242
commit
434d135f12
@ -527,7 +527,7 @@ function wp_http_validate_url( $url ) {
|
||||
|
||||
if ( ! $same_host ) {
|
||||
$host = trim( $parsed_url['host'], '.' );
|
||||
if ( preg_match( '#^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$#', $host ) ) {
|
||||
if ( preg_match( '#^(([1-9]?\d|1\d\d|25[0-5]|2[0-4]\d)\.){3}([1-9]?\d|1\d\d|25[0-5]|2[0-4]\d)$#', $host ) ) {
|
||||
$ip = $host;
|
||||
} else {
|
||||
$ip = gethostbyname( $host );
|
||||
|
Loading…
Reference in New Issue
Block a user