[wp-trac] [WordPress Trac] #52622: Fix PHP Warning on PHP7.2 in class-wp-http-curl.php

WordPress Trac noreply at wordpress.org
Wed Mar 31 14:14:19 UTC 2021


#52622: Fix PHP Warning on PHP7.2 in class-wp-http-curl.php
---------------------------+-----------------------------------------------
 Reporter:  sjoerdlinders  |       Owner:  SergeyBiryukov
     Type:  defect (bug)   |      Status:  reviewing
 Priority:  normal         |   Milestone:  5.8
Component:  HTTP API       |     Version:  5.6.2
 Severity:  normal         |  Resolution:
 Keywords:  has-patch      |     Focuses:  administration, coding-standards
---------------------------+-----------------------------------------------
Changes (by sjoerdlinders):

 * keywords:  has-patch reporter-feedback => has-patch


Comment:

 **Third and final change:**
 Added the default settings parameter 'stream' with a default null value.

 {{{#!php
 $defaults = array(
         'method'      => 'GET',
         'timeout'     => 5,
         'redirection' => 5,
         'httpversion' => '1.0',
         'blocking'    => true,
         'headers'     => array(),
         'body'        => null,
         'cookies'     => array(),
         'decompress'  => false,
         'stream'      => null,
         'filename'    => '',
 );
 }}}

 If this array element is not pre-defined it will result in a E_NOTICE
 'Undefined index: stream' on line 299:

 {{{#!php
 if ( $parsed_args['stream'] ) {
 }}}

 This can be reproduces and will show exactly the same result problems as
 discribed in my reply #comment:5

 (https://github.com/WordPress/wordpress-develop/pull/1036/)

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/52622#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list