From 70a92ca96ecf4ff2bc618f6f5d2060446b79f126 Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Wed, 10 Jan 2018 02:49:49 +0000 Subject: [PATCH] Streams: When checking in `wp_is_stream()` escape the stream wrapper names for PCRE to avoid PHP warnings when invalid stream wrappers are registered. Fixes #43054. git-svn-id: https://develop.svn.wordpress.org/trunk@42432 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/functions.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/wp-includes/functions.php b/src/wp-includes/functions.php index 9b5f292eec..320d76918e 100644 --- a/src/wp-includes/functions.php +++ b/src/wp-includes/functions.php @@ -5459,6 +5459,7 @@ function _device_can_upload() { */ function wp_is_stream( $path ) { $wrappers = stream_get_wrappers(); + $wrappers = array_map( 'preg_quote', $wrappers ); $wrappers_re = '(' . join( '|', $wrappers ) . ')'; return preg_match( "!^$wrappers_re://!", $path ) === 1;