diff --git src/wp-includes/functions.php src/wp-includes/functions.php
index 5802a34146..9308191445 100644
--- src/wp-includes/functions.php
+++ src/wp-includes/functions.php
@@ -5228,6 +5228,9 @@ function _device_can_upload() {
  */
 function wp_is_stream( $path ) {
 	$wrappers = stream_get_wrappers();
+	foreach ( $wrappers as &$wrapper ) {
+		$wrapper = preg_quote( $wrapper, '!' );
+	}
 	$wrappers_re = '(' . join('|', $wrappers) . ')';
 
 	return preg_match( "!^$wrappers_re://!", $path ) === 1;
