mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-07 22:24:36 +00:00
Better validation of the URL used in core HTTP requests.
git-svn-id: https://develop.svn.wordpress.org/trunk@24480 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -496,6 +496,7 @@ 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';
|
||||
@@ -543,7 +544,7 @@ function wp_get_http_headers( $url, $deprecated = false ) {
|
||||
if ( !empty( $deprecated ) )
|
||||
_deprecated_argument( __FUNCTION__, '2.7' );
|
||||
|
||||
$response = wp_remote_head( $url );
|
||||
$response = wp_remote_head( $url, array( 'reject_unsafe_urls' => true ) );
|
||||
|
||||
if ( is_wp_error( $response ) )
|
||||
return false;
|
||||
@@ -758,6 +759,7 @@ function wp_remote_fopen( $uri ) {
|
||||
|
||||
$options = array();
|
||||
$options['timeout'] = 10;
|
||||
$options['reject_unsafe_urls'] = true;
|
||||
|
||||
$response = wp_remote_get( $uri, $options );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user