[wp-trac] [WordPress Trac] #51423: Fix function argument type issues reported by PHPStan
WordPress Trac
noreply at wordpress.org
Sun Aug 1 14:55:07 UTC 2021
#51423: Fix function argument type issues reported by PHPStan
-------------------------------------------+-------------------------------
Reporter: SergeyBiryukov | Owner: hellofromTonya
Type: task (blessed) | Status: assigned
Priority: normal | Milestone: 5.9
Component: General | Version:
Severity: normal | Resolution:
Keywords: php8 has-patch has-unit-tests | Focuses: coding-standards
-------------------------------------------+-------------------------------
Comment (by SergeyBiryukov):
In [changeset:"51524" 51524]:
{{{
#!CommitTicketReference repository="" revision="51524"
Themes: Make sure `get_theme_mods()` always returns an array.
This avoids a "Cannot access offset of type string on string" fatal error
in `set_theme_mod()` on PHP 8 if the `theme_mods_$theme_slug` option has
an incorrect value, e.g. an empty string instead of an array.
With this change, `set_theme_mod()` should be able to resolve the issue by
saving a correct value.
Follow-up to [15736], [15739], [30672], [32629], [32632].
Props xknown.
See #51423.
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/51423#comment:105>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list