diff --git src/wp-includes/functions.php src/wp-includes/functions.php
index f3070315f6..99d69c24d3 100644
|
|
|
function _device_can_upload() {
|
| 5631 | 5631 | * @return bool True if the path is a stream URL. |
| 5632 | 5632 | */ |
| 5633 | 5633 | function wp_is_stream( $path ) { |
| 5634 | | if ( false === strpos( $path, '://' ) ) { |
| | 5634 | $scheme_separator = strpos( $path, '://' ); |
| | 5635 | |
| | 5636 | if ( false === $scheme_separator ) { |
| 5635 | 5637 | // $path isn't a stream |
| 5636 | 5638 | return false; |
| 5637 | 5639 | } |
| 5638 | 5640 | |
| 5639 | | $wrappers = stream_get_wrappers(); |
| 5640 | | $wrappers = array_map( 'preg_quote', $wrappers ); |
| 5641 | | $wrappers_re = '(' . join( '|', $wrappers ) . ')'; |
| | 5641 | $stream = substr( $path, 0, $scheme_separator ); |
| 5642 | 5642 | |
| 5643 | | return preg_match( "!^$wrappers_re://!", $path ) === 1; |
| | 5643 | return in_array( $stream, stream_get_wrappers(), true ); |
| 5644 | 5644 | } |
| 5645 | 5645 | |
| 5646 | 5646 | /** |