Make WordPress Core

Ticket #45553: 45553.diff

File 45553.diff, 830 bytes (added by swissspidy, 8 years ago)
  • src/wp-includes/functions.php

    diff --git src/wp-includes/functions.php src/wp-includes/functions.php
    index f3070315f6..99d69c24d3 100644
    function _device_can_upload() {  
    56315631 * @return bool True if the path is a stream URL.
    56325632 */
    56335633function wp_is_stream( $path ) {
    5634         if ( false === strpos( $path, '://' ) ) {
     5634        $scheme_separator = strpos( $path, '://' );
     5635
     5636        if ( false === $scheme_separator ) {
    56355637                // $path isn't a stream
    56365638                return false;
    56375639        }
    56385640
    5639         $wrappers    = stream_get_wrappers();
    5640         $wrappers    = array_map( 'preg_quote', $wrappers );
    5641         $wrappers_re = '(' . join( '|', $wrappers ) . ')';
     5641        $stream = substr( $path, 0, $scheme_separator );
    56425642
    5643         return preg_match( "!^$wrappers_re://!", $path ) === 1;
     5643        return in_array( $stream, stream_get_wrappers(), true );
    56445644}
    56455645
    56465646/**