[wp-trac] [WordPress Trac] #56198: Check cache key type

WordPress Trac noreply at wordpress.org
Sat Jul 16 10:42:04 UTC 2022


#56198: Check cache key type
-------------------------+--------------------------
 Reporter:  tillkruess   |       Owner:  (none)
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  6.1
Component:  Cache API    |     Version:  trunk
 Severity:  normal       |  Resolution:
 Keywords:  has-patch    |     Focuses:  performance
-------------------------+--------------------------

Comment (by malthert):

 Replying to [comment:13 tillkruess]:
 > >What about the trimming of empty groups?
 >
 > We can safeguard against that as well in the patch, if desired. I seem
 to recall that `empty(trim())` doesn't work on PHP 5.6 and it may need a
 dedicated variable, which would mean more code.

 I tested with PHP 5.6.40 and could not reproduce such an issue. There is
 no extra variable needed: (same result for PHP 5.6, 7.4 and 8.1)

 {{{#!php
 <?php
 $group = '   ';
 if ( empty( trim( $group ) ) ) {
         echo "empty";
 }
 }}}

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


More information about the wp-trac mailing list