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:
parent
07d244a054
commit
70a92ca96e
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue