Skip to content

Commit

Permalink
Merge pull request #272 from dshanske/sideloadfix
Browse files Browse the repository at this point in the history
Check if download is valid before trying to sideload it
  • Loading branch information
dshanske authored Aug 13, 2024
2 parents 46090f4 + af8ebf9 commit 20ed0b0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion includes/class-indieauth-client-taxonomy.php
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,11 @@ public static function sideload_icon( $url, $client_id ) {
}

// Download Profile Picture and add as attachment
$file = wp_get_image_editor( download_url( $url, 300 ) );
$download = download_url( $url, 300 );
if ( is_wp_error( $download ) ) {
return false;
}
$file = wp_get_image_editor( $download );
if ( is_wp_error( $file ) ) {
return false;
}
Expand Down

0 comments on commit 20ed0b0

Please sign in to comment.