Make WordPress Core

Changeset 56128


Ignore:
Timestamp:
07/03/2023 02:01:25 PM (23 months ago)
Author:
SergeyBiryukov
Message:

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.

Location:
trunk/src/wp-includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-http-curl.php

    r55646 r56128  
    7979            'body'        => null,
    8080            'cookies'     => array(),
     81            'decompress'  => false,
     82            'stream'      => false,
     83            'filename'    => null,
    8184        );
    8285
  • trunk/src/wp-includes/class-wp-http-streams.php

    r55886 r56128  
    3838            'body'        => null,
    3939            'cookies'     => array(),
     40            'decompress'  => false,
     41            'stream'      => false,
     42            'filename'    => null,
    4043        );
    4144
Note: See TracChangeset for help on using the changeset viewer.