Skip to content

Commit

Permalink
Removed unnecessary filter rejecting unsafe URLs (#588)
Browse files Browse the repository at this point in the history
  • Loading branch information
pbking authored Apr 24, 2024
1 parent 3ba985d commit 05acf3c
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions admin/create-theme/theme-media.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,6 @@ public static function make_relative_media_url( $absolute_url ) {
*/
public static function add_media_to_local( $media ) {

//TODO: Hack to allow http localhost (a common environment...)
function turn_off_reject_unsafe_urls( $args ) {
$args['reject_unsafe_urls'] = false;
$args['sslverify'] = false;
return $args;
}
add_filter( 'http_request_args', 'turn_off_reject_unsafe_urls' );

foreach ( $media as $url ) {

$download_file = download_url( $url );
Expand All @@ -128,6 +120,7 @@ function turn_off_reject_unsafe_urls( $args ) {
rename( $download_file, $media_path . basename( $url ) );
}
}

}


Expand Down

0 comments on commit 05acf3c

Please sign in to comment.