[wp-trac] [WordPress Trac] #50913: PHP 8.0: various compatibility fixes
WordPress Trac
noreply at wordpress.org
Wed Sep 30 15:44:25 UTC 2020
#50913: PHP 8.0: various compatibility fixes
-------------------------------------------+-------------------------------
Reporter: jrf | Owner: SergeyBiryukov
Type: task (blessed) | Status: reviewing
Priority: normal | Milestone: 5.6
Component: General | Version:
Severity: normal | Resolution:
Keywords: php8 has-patch needs-dev-note | Focuses: coding-standards
-------------------------------------------+-------------------------------
Comment (by SergeyBiryukov):
In [changeset:"49076" 49076]:
{{{
#!CommitTicketReference repository="" revision="49076"
Code Modernization: Ignore the `_multiwidget` property when collecting
widget numbers in `WP_Customize_Manager::import_theme_starter_content()`.
PHP 8 changes the way string to number comparisons are performed:
https://wiki.php.net/rfc/string_to_number_comparison
In particular, when calling `max()` on an array with numeric values and a
non-numeric string, in PHP 8 the string is returned instead of a number.
For `::import_theme_starter_content()`, this resulted in retrieving the
`_multiwidget` property instead of the maximum widget number for a
particular type.
By explicitly ignoring the `_multiwidget` property, we make sure to
retrieve the correct widget number value.
Follow-up to [48960], [49043].
See #50913.
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/50913#comment:56>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list