Opened 17 months ago
Closed 15 months ago
#63221 closed defect (bug) (invalid)
Deprecated Warning in wp_parse_list() When Passing Null Value
| Reported by: | dilipbheda | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | General | Version: | |
| Severity: | normal | Keywords: | has-patch close |
| Cc: | Focuses: | php-compatibility |
Description
When calling wp_parse_list( get_option( 'custom_theme_settings', null ) ), a deprecated warning appears in PHP 8.1+ due to passing null to preg_split().
Deprecated: preg_split(): Passing null to parameter #2 ($subject) of type string is deprecated in /var/www/html/codeinwp/wp-includes/functions.php on line 4967
Steps to Reproduce:
- Call
get_option( 'custom_theme_settings', null )where the option does not exist. - Pass the result to
wp_parse_list() - Observe the deprecated warning in PHP 8.1+
Change History (3)
This ticket was mentioned in PR #8641 on WordPress/wordpress-develop by @dilipbheda.
17 months ago
#1
#3
@
15 months ago
- Milestone Awaiting Review
- Resolution → invalid
- Status new → closed
Thank you for reporting. However, for now I think moving this on with a close is the better approach as has been recommended. Let's do just that and we can always review should further information come up. Thank you.
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Our philosophy with this kind of issue has so far been that it should be fixed on the caller side. Instead of passing
nulltowp_parse_list()you should just pass a string.So you should do
wp_parse_list( get_option( 'custom_theme_settings', '' ) )instead.