Opened 13 months ago
Closed 11 months ago
#59940 closed defect (bug) (duplicate)
PHP Deprecated Errors In Core
Reported by: | jmorti | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 6.4 |
Component: | General | Keywords: | |
Focuses: | php-compatibility | Cc: |
Description (last modified by )
Hi, I updated my server to PHP 8 and started getting errors in the debug log that you might want to look into. WordPress is updated so I'm afraid these bugs were missed. You can't pass NULL to these two functions anymore. Thanks.
PHP Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /wp-includes/functions.php on line 7241
PHP Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /wp-includes/functions.php on line 2187
Change History (3)
#3
@
11 months ago
- Keywords reporter-feedback removed
- Milestone Awaiting Review deleted
- Resolution set to duplicate
- Status changed from new to closed
#57580 was an earlier ticket with reports about the deprecated warnings for wp_normalize_path()
and wp_is_stream()
.
The four causes identified there were all plugins that had added null
in the add_submenu_page()
function. Those four plugins have been updated for newer PHP, but a directory search still finds many plugins doing it wrong.
If you identify the issue in a plugin, please report it to the plugin's author. If you also would like to share details about the source of the problem, you could comment on #57580.
Hi and welcome to WordPress Core Trac!
#57580, #57581 and #59757 have similar reports about the
wp_normalize_path()
function (line 2187), which also involveswp_is_stream()
(line 7241). The$path
parameter has needed to be a string since the function was introduced.Can you determine what code is incorrectly trying to use
null
withwp_normalize_path()
? If that is in a plugin, the error will need to be reported to its author(s).