diff --git a/src/wp-includes/functions.php b/src/wp-includes/functions.php index fcb60e6eb3846..0704d067a028c 100644 --- a/src/wp-includes/functions.php +++ b/src/wp-includes/functions.php @@ -2192,7 +2192,7 @@ function wp_normalize_path( $path ) { } // Standardize all paths to use '/'. - $path = str_replace( '\\', '/', $path ); + $path = str_replace('\\', '/', $path ?? ''); // Replace multiple slashes down to a singular, allowing for network shares having two slashes. $path = preg_replace( '|(?<=.)/+|', '/', $path ); @@ -7357,7 +7357,7 @@ function _device_can_upload() { * @return bool True if the path is a stream URL. */ function wp_is_stream( $path ) { - $scheme_separator = strpos( $path, '://' ); + $scheme_separator = strpos($path ?? '', '://'); if ( false === $scheme_separator ) { // $path isn't a stream.