From af9f0520875eda686fd13a427fd3914d7aded049 Mon Sep 17 00:00:00 2001 From: Dominik Schilling Date: Wed, 30 Mar 2016 15:38:26 +0000 Subject: [PATCH] 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 --- wp-includes/http.php | 4 ++-- wp-includes/version.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/wp-includes/http.php b/wp-includes/http.php index 05792c29c2..dc750371ac 100644 --- a/wp-includes/http.php +++ b/wp-includes/http.php @@ -523,7 +523,7 @@ 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; @@ -531,7 +531,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 ); diff --git a/wp-includes/version.php b/wp-includes/version.php index 5fd0e7d856..edc8d0a6b7 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -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.