diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 9a8b4cf911..39de1470e2 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -5706,16 +5706,16 @@ function _device_can_upload() { * @return bool True if the path is a stream URL. */ function wp_is_stream( $path ) { - if ( false === strpos( $path, '://' ) ) { + $scheme_separator = strpos( $path, '://' ); + + if ( false === $scheme_separator ) { // $path isn't a stream return false; } - $wrappers = stream_get_wrappers(); - $wrappers = array_map( 'preg_quote', $wrappers ); - $wrappers_re = '(' . join( '|', $wrappers ) . ')'; + $stream = substr( $path, 0, $scheme_separator ); - return preg_match( "!^$wrappers_re://!", $path ) === 1; + return in_array( $stream, stream_get_wrappers(), true ); } /** diff --git a/wp-includes/version.php b/wp-includes/version.php index 0ad528530c..847d505711 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.1-alpha-44505'; +$wp_version = '5.1-alpha-44506'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.