From efe0a28c1843356cbf92a679e1758e22e018cc41 Mon Sep 17 00:00:00 2001 From: dd32 Date: Sun, 18 Apr 2010 04:58:19 +0000 Subject: [PATCH] Bail from WP_HTTP when a invalid URL is provided. Fixes #12964 git-svn-id: http://svn.automattic.com/wordpress/trunk@14134 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-http.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wp-includes/class-http.php b/wp-includes/class-http.php index ee08e424c..b5075cc32 100644 --- a/wp-includes/class-http.php +++ b/wp-includes/class-http.php @@ -240,6 +240,9 @@ class WP_Http { $arrURL = parse_url($url); + if ( empty( $url ) || empty($url['scheme'] ) ) + return new WP_Error('http_request_failed', __('A valid URL was not provided.')); + if ( $this->block_request( $url ) ) return new WP_Error('http_request_failed', __('User has blocked requests through HTTP.'));