From 204b90b63500567e365bfac331bee94a46973001 Mon Sep 17 00:00:00 2001 From: Joost de Valk Date: Tue, 6 Feb 2024 10:42:32 +0100 Subject: [PATCH] Update wp_http_fetch.php (#1002) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Using `''` instead of `null` in Wp_Http_Fetch to prevent the following error: ```json { “type”:“deprecated”, “message”:“http_build_query(): Passing null to parameter #2 ($numeric_prefix) of type string is deprecated”,“file”:“wp-content/mu-plugins/playground-includes/wp_http_fetch.php”,“line”:113,“stack”:[“http_build_query()“,”Wp_Http_Fetch_Base::format_get()“,”Wp_Http_Fetch_Base->request()“,”WpOrg\Requests\Requests::request()“,”WP_Http->request()“,”WP_Http->get()“,”wp_remote_get()“,”WP_Community_Events->get_events()“,”wp_ajax_get_community_events()“,”do_action(‘wp_ajax_get-community-events’)“],“component”:“MU Plugin: playground-includes” } ``` --- .../playground-mu-plugin/playground-includes/wp_http_fetch.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/playground/remote/src/lib/playground-mu-plugin/playground-includes/wp_http_fetch.php b/packages/playground/remote/src/lib/playground-mu-plugin/playground-includes/wp_http_fetch.php index 6c2131d8e6..ecdaf90b33 100644 --- a/packages/playground/remote/src/lib/playground-mu-plugin/playground-includes/wp_http_fetch.php +++ b/packages/playground/remote/src/lib/playground-mu-plugin/playground-includes/wp_http_fetch.php @@ -110,7 +110,7 @@ protected static function format_get($url, $data) } else { $query = $url_parts['query']; } - $query .= '&' . http_build_query($data, null, '&'); + $query .= '&' . http_build_query($data, '', '&'); $query = trim($query, '&'); if (empty($url_parts['query'])) { $url .= '?' . $query;