[wp-trac] [WordPress Trac] #62011: Deprecated: strpos(): Passing null to parameter
WordPress Trac
noreply at wordpress.org
Sun Sep 8 11:18:14 UTC 2024
#62011: Deprecated: strpos(): Passing null to parameter
-------------------------------+-----------------------------
Reporter: calliko | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Administration | Version: 6.6.1
Severity: minor | Keywords:
Focuses: php-compatibility |
-------------------------------+-----------------------------
There is a warning in the admin panel:
Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type
string is deprecated in A:\OSPanel\home\homewp.ru\wp-
includes\functions.php on line 7303
With these changes there will be no error:
function wp_is_stream( $path ) {
/*new code start*/
if($path===null){
return false;
}
/*new code end*/
$scheme_separator = strpos( $path, '://' );
if ( false === $scheme_separator ) {
// $path isn't a stream.
return false;
}
$stream = substr( $path, 0, $scheme_separator );
return in_array( $stream, stream_get_wrappers(), true );
}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/62011>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list