diff --git a/src/Uplink/API/Validation_Response.php b/src/Uplink/API/Validation_Response.php index 8bc42dc7..fefc7fa1 100644 --- a/src/Uplink/API/Validation_Response.php +++ b/src/Uplink/API/Validation_Response.php @@ -284,7 +284,7 @@ public function get_update_details() { $update->url = $this->response->homepage ?? ''; $update->tested = $this->response->tested ?? ''; $update->requires = $this->response->requires ?? ''; - $update->package = $this->response->download_url ? $this->response->download_url . '&pu_get_download=1&key=' . $this->get_key() : ''; + $update->package = $this->response->download_url ? $this->response->download_url . '&key=' . urlencode( $this->get_key() ) : ''; if ( ! empty( $this->response->upgrade_notice ) ) { $update->upgrade_notice = $this->response->upgrade_notice; @@ -495,7 +495,7 @@ public function to_wp_format() { } //Other fields need to be renamed and/or transformed. - $info->download_link = isset( $this->response->download_url ) ? $this->response->download_url . '&pu_get_download=1' : ''; + $info->download_link = isset( $this->response->download_url ) ? $this->response->download_url : ''; if ( ! empty( $this->author_homepage ) && ! empty( $this->response->author ) ) { $info->author = sprintf( '%s', esc_url( $this->author_homepage ), $this->response->author ); diff --git a/tests/_support/Helper/Http_API/Http_API_Mock.php b/tests/_support/Helper/Http_API/Http_API_Mock.php index 94bd4d98..cb945a6a 100644 --- a/tests/_support/Helper/Http_API/Http_API_Mock.php +++ b/tests/_support/Helper/Http_API/Http_API_Mock.php @@ -2,6 +2,8 @@ namespace StellarWP\Uplink\Tests\Http_API; +use WpOrg\Requests\Response as Requests_Response; + abstract class Http_API_Mock { /** * A map from status codes to the HTTP standard status description. @@ -99,7 +101,7 @@ public function make_response( int $status_code, $body, string $content_type = ' $url = rtrim( $this->get_url(), '/' ); $current_date = ( new \DateTime( 'now', new \DateTimezone( 'GMT' ) ) )->format( 'D, d M Y H:i:s GMT' ); - $request_response = new \Requests_Response(); + $request_response = new Requests_Response(); $request_response->headers = new \Requests_Response_Headers( [ 'date' => [ $current_date ], 'content-type' => [ "$content_type; charset=UTF-8" ],