[wp-trac] [WordPress Trac] #59940: PHP Deprecated Errors In Core
WordPress Trac
noreply at wordpress.org
Tue Nov 21 17:37:14 UTC 2023
#59940: PHP Deprecated Errors In Core
-------------------------------+--------------------------------
Reporter: jmorti | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version: 6.4
Severity: normal | Resolution:
Keywords: reporter-feedback | Focuses: php-compatibility
-------------------------------+--------------------------------
Changes (by sabernhardt):
* keywords: => reporter-feedback
Old description:
> 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
New description:
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`
--
Comment:
Hi and welcome to WordPress Core Trac!
#57580, #57581 and #59757 have similar reports about the
`wp_normalize_path()` function
([https://core.trac.wordpress.org/browser/branches/6.4/src/wp-
includes/functions.php?rev=56995#L2187 line 2187]), which also involves
`wp_is_stream()`
([https://core.trac.wordpress.org/browser/branches/6.4/src/wp-
includes/functions.php?rev=56995#L7241 line 7241]). The `$path` parameter
has needed to be a string
[https://core.trac.wordpress.org/changeset/27158/trunk/src/wp-
includes/functions.php since the function was introduced].
Can you determine what code is incorrectly trying to use `null` with
`wp_normalize_path()`? If that is in a plugin, the error will need to be
reported to its author(s).
--
Ticket URL: <https://core.trac.wordpress.org/ticket/59940#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list