[wp-trac] [WordPress Trac] #57266: wp_suspend_cache_invalidation can be set to no Boolean value which break usage

WordPress Trac noreply at wordpress.org
Sat Dec 3 05:01:34 UTC 2022


#57266: wp_suspend_cache_invalidation can be set to no Boolean value which break
usage
--------------------------------------+------------------------------
 Reporter:  pbearne                   |       Owner:  (none)
     Type:  defect (bug)              |      Status:  new
 Priority:  normal                    |   Milestone:  Awaiting Review
Component:  General                   |     Version:
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+------------------------------

Comment (by costdev):

 Nicely spotted @pbearne!

 Looks like we can do something along these lines:

 {{{#!php
 <?php

 if ( ! is_bool( $suspend ) ) {
     _doing_it_wrong(
         __FUNCTION__,
         sprintf(
             /* translators: %s: The "$suspend" variable name. */
             __( '"%s" must be of type "bool".' ),
         ),
         '6.2.0'
     );

     $suspend = (bool) $suspend;
 }
 }}}

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


More information about the wp-trac mailing list