Skip to content
Permalink
Browse files

HTTP: Improve detection of valid IP addresses.

Built from https://develop.svn.wordpress.org/trunk@37115


git-svn-id: http://core.svn.wordpress.org/trunk@37082 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information...
ocean90 committed Mar 30, 2016
1 parent 9e4415b commit af9f0520875eda686fd13a427fd3914d7aded049
Showing with 3 additions and 3 deletions.
  1. +2 −2 wp-includes/http.php
  2. +1 −1 wp-includes/version.php
@@ -523,15 +523,15 @@ function wp_http_validate_url( $url ) {
$parsed_home = @parse_url( get_option( 'home' ) );
if ( isset( $parsed_home['host'] ) ) {
if ( isset( $parsed_home['host'] ) ) {
$same_host = ( strtolower( $parsed_home['host'] ) === strtolower( $parsed_url['host'] ) || 'localhost' === strtolower( $parsed_url['host'] ) );
} else {
$same_host = false;
}
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 );
@@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.5-RC1-37114';
$wp_version = '4.5-RC1-37115';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.

0 comments on commit af9f052

Please sign in to comment.
You can’t perform that action at this time.