Skip to content

Commit 94aaa2d

Browse files
HTTP API: Declare a few default parameters in WP_Http_Curl and WP_Http_Streams.
This resolves `Undefined array key` PHP warnings when trying to access any of these values in `WP_Http_Curl::request()` or `WP_Http_Streams::request()`: * `$parsed_args['decompress']` * `$parsed_args['stream']` * `$parsed_args['filename']` Follow-up to [10410], [11236], [13274], [17555], [37428], [42766], [44346]. Props sjoerdlinders, hellofromTonya, jrf, oglekler, Clorith, SergeyBiryukov. Fixes #52622. git-svn-id: https://develop.svn.wordpress.org/trunk@56128 602fd350-edb4-49c9-b593-d223f7449a82
1 parent d1f9292 commit 94aaa2d

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/wp-includes/class-wp-http-curl.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ public function request( $url, $args = array() ) {
7878
'headers' => array(),
7979
'body' => null,
8080
'cookies' => array(),
81+
'decompress' => false,
82+
'stream' => false,
83+
'filename' => null,
8184
);
8285

8386
$parsed_args = wp_parse_args( $args, $defaults );

src/wp-includes/class-wp-http-streams.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ public function request( $url, $args = array() ) {
3737
'headers' => array(),
3838
'body' => null,
3939
'cookies' => array(),
40+
'decompress' => false,
41+
'stream' => false,
42+
'filename' => null,
4043
);
4144

4245
$parsed_args = wp_parse_args( $args, $defaults );

0 commit comments

Comments
 (0)