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

WordPress Trac noreply at wordpress.org
Tue Mar 2 09:41:41 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 reporter-      |     Focuses:  administration,
  feedback                           |  coding-standards
-------------------------------------+-------------------------------------

Comment (by sjoerdlinders):

 **Second change:**
 Added the default settings parameter 'filename' with a default empty
 string value ''.

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

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

 {{{#!php
 'filename' => $parsed_args['filename'],
 }}}

 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:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list