[wp-trac] [WordPress Trac] #46848: translate_level_to_role may return void in wp-admin/includes/upgrade.php

WordPress Trac noreply at wordpress.org
Tue Apr 9 14:14:03 UTC 2019


#46848: translate_level_to_role may return void in wp-admin/includes/upgrade.php
-----------------------------+-----------------------------
 Reporter:  diddledan        |      Owner:  (none)
     Type:  defect (bug)     |     Status:  new
 Priority:  normal           |  Milestone:  Awaiting Review
Component:  Upgrade/Install  |    Version:  2.0
 Severity:  normal           |   Keywords:  has-patch
  Focuses:                   |
-----------------------------+-----------------------------
 The function `translate_level_to_role()` is defined and used in `wp-
 admin/includes/upgrade.php` in the function `upgrade_160`. The usage
 requires that the function return a string or numeric to be used in a
 subsequent array key. The function may return void which cannot be used as
 a key. For correctness the function should always return a value. Patch
 attached adds a `default` selector to the `switch` statement to achieve
 this.

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


More information about the wp-trac mailing list