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
This commit is contained in:
Dion Hulse 2018-01-10 02:49:49 +00:00
parent 07d244a054
commit 70a92ca96e
1 changed files with 1 additions and 0 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;