mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user