WordPress.org

Make WordPress Core

Changeset 43483


Ignore:
Timestamp:
07/17/2018 03:18:12 PM (15 months ago)
Author:
SergeyBiryukov
Message:

Streams: When checking in wp_is_stream() escape the stream wrapper names for PCRE to avoid PHP warnings when invalid stream wrappers are registered.

Props dd32.
Merges [42432] to the 4.9 branch.
Fixes #43054.

Location:
branches/4.9
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.9

  • branches/4.9/src/wp-includes/functions.php

    r43393 r43483  
    52285228 */
    52295229function wp_is_stream( $path ) {
    5230     $wrappers = stream_get_wrappers();
    5231     $wrappers_re = '(' . join('|', $wrappers) . ')';
     5230    $wrappers    = stream_get_wrappers();
     5231    $wrappers    = array_map( 'preg_quote', $wrappers );
     5232    $wrappers_re = '(' . join( '|', $wrappers ) . ')';
    52325233
    52335234    return preg_match( "!^$wrappers_re://!", $path ) === 1;
Note: See TracChangeset for help on using the changeset viewer.