Skip to content

Commit

Permalink
Update wp_http_fetch.php (#1002)
Browse files Browse the repository at this point in the history
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”
}
```
  • Loading branch information
jdevalk authored Feb 6, 2024
1 parent 1c0f359 commit 204b90b
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 204b90b

Please sign in to comment.