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.

Built from https://develop.svn.wordpress.org/trunk@42432


git-svn-id: http://core.svn.wordpress.org/trunk@42262 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Dion Hulse 2018-01-10 02:50:46 +00:00
parent 7bfc60864f
commit cdfa5adc43
2 changed files with 2 additions and 1 deletions

View File

@ -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;

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.0-alpha-42431';
$wp_version = '5.0-alpha-42432';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.