[wp-trac] [WordPress Trac] #55912: count( $_wp_admin_css_colors ) in user-edit.php not php 8 friendly when int given

WordPress Trac noreply at wordpress.org
Fri Jun 3 19:12:36 UTC 2022


#55912: count( $_wp_admin_css_colors ) in user-edit.php not php 8 friendly when int
given
--------------------------+-----------------------------
 Reporter:  rambillo      |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Users         |    Version:
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 Running WordPress core v6.0 with PHP v8.0.14, all plugins turned off, and
 a default theme (on a long running installation of WordPress), we're
 getting:

 {{{
 Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of
 type Countable|array, int given in /.../wp-admin/user-edit.php:303 Stack
 trace: #0 /.../wp-admin/profile.php(18): require_once() #1 {main} thrown
 in /.../wp-admin/user-edit.php on line 303

 There has been a critical error on this website. Please check your site
 admin email inbox for instructions.
 }}}

 The code on that line suggests it could be addressed via:
 {{{
 if ( is_countable( $_wp_admin_css_colors ) && count( $_wp_admin_css_colors
 ) > 1 && has_action( 'admin_color_scheme_picker' ) ) : ?>
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/55912>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list