Use wp_safe_remote_request() and friends instead of reject_unsafe_urls = true.

fixes #24646.



git-svn-id: https://develop.svn.wordpress.org/trunk@24917 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin
2013-07-31 06:52:13 +00:00
parent 6894354b9b
commit 9d5bd5f7eb
8 changed files with 13 additions and 19 deletions

View File

@@ -496,14 +496,13 @@ function wp_get_http( $url, $file_path = false, $red = 1 ) {
$options = array();
$options['redirection'] = 5;
$options['reject_unsafe_urls'] = true;
if ( false == $file_path )
$options['method'] = 'HEAD';
else
$options['method'] = 'GET';
$response = wp_remote_request($url, $options);
$response = wp_safe_remote_request( $url, $options );
if ( is_wp_error( $response ) )
return false;
@@ -544,7 +543,7 @@ function wp_get_http_headers( $url, $deprecated = false ) {
if ( !empty( $deprecated ) )
_deprecated_argument( __FUNCTION__, '2.7' );
$response = wp_remote_head( $url, array( 'reject_unsafe_urls' => true ) );
$response = wp_safe_remote_head( $url );
if ( is_wp_error( $response ) )
return false;
@@ -759,9 +758,8 @@ function wp_remote_fopen( $uri ) {
$options = array();
$options['timeout'] = 10;
$options['reject_unsafe_urls'] = true;
$response = wp_remote_get( $uri, $options );
$response = wp_safe_remote_get( $uri, $options );
if ( is_wp_error( $response ) )
return false;