[wp-trac] [WordPress Trac] #53635: PHP 8.1: various compatibility fixes

WordPress Trac noreply at wordpress.org
Mon Aug 30 15:19:54 UTC 2021


#53635: PHP 8.1: various compatibility fixes
-------------------------------------------------+-------------------------
 Reporter:  SergeyBiryukov                       |       Owner:
                                                 |  hellofromTonya
     Type:  task (blessed)                       |      Status:  accepted
 Priority:  normal                               |   Milestone:  5.9
Component:  General                              |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  php81 has-patch has-unit-tests       |     Focuses:  coding-
  commit                                         |  standards
-------------------------------------------------+-------------------------

Comment (by hellofromTonya):

 In [changeset:"51695" 51695]:
 {{{
 #!CommitTicketReference repository="" revision="51695"
 Code Modernization: Add input validation to `_set_cron_array()`.

 The private `_set_cron_array()` function expects a cron array as the first
 parameter, but will often be passed the - potentially updated - output of
 a call to `_get_cron_array()`.

 When the `_get_cron_array()` function returns `false`, a "Deprecated:
 Automatic conversion of false to array is deprecated" warning will be
 thrown on PHP 8.1.

 The input validation resolves the deprecation warning by setting the cron
 value to an empty array when not given an `array` data type.

 Adds a full set of `_set_cron_array()` tests.

 Follow-up to [4189], [50152].

 Props jrf, hellofromTonya, peterwilsoncc.
 See #53635.
 }}}

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


More information about the wp-trac mailing list