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
+1 -2
View File
@@ -183,7 +183,6 @@ class WP_Importer {
$headers = array();
$args = array();
$args['reject_unsafe_urls'] = true;
if ( true === $head )
$args['method'] = 'HEAD';
if ( !empty( $username ) && !empty( $password ) )
@@ -191,7 +190,7 @@ class WP_Importer {
$args['headers'] = $headers;
return wp_remote_request( $url, $args );
return wp_safe_remote_request( $url, $args );
}
/**
+1 -1
View File
@@ -497,7 +497,7 @@ function download_url( $url, $timeout = 300 ) {
if ( ! $tmpfname )
return new WP_Error('http_no_file', __('Could not create Temporary file.'));
$response = wp_remote_get( $url, array( 'timeout' => $timeout, 'stream' => true, 'filename' => $tmpfname, 'reject_unsafe_urls' => true ) );
$response = wp_safe_remote_get( $url, array( 'timeout' => $timeout, 'stream' => true, 'filename' => $tmpfname ) );
if ( is_wp_error( $response ) ) {
unlink( $tmpfname );