diff --git src/wp-includes/functions.php src/wp-includes/functions.php
index b00a47c1d8..c6bddaebda 100644
|
|
function wp_mkdir_p( $target ) { |
1816 | 1816 | * @return bool True if path is absolute, false is not absolute. |
1817 | 1817 | */ |
1818 | 1818 | function path_is_absolute( $path ) { |
| 1819 | /* |
| 1820 | * Check to see if the path is a stream and check to see if its an actual |
| 1821 | * path or file as realpath() does not support streamwrappers. |
| 1822 | */ |
| 1823 | if ( wp_is_stream( $path ) && ( is_dir( $path ) || is_file ( $path ) ) ) { |
| 1824 | return true; |
| 1825 | } |
| 1826 | |
1819 | 1827 | /* |
1820 | 1828 | * This is definitive if true but fails if $path does not exist or contains |
1821 | 1829 | * a symbolic link. |
… |
… |
function wp_delete_file( $file ) { |
6005 | 6013 | * @return bool True on success, false on failure. |
6006 | 6014 | */ |
6007 | 6015 | function wp_delete_file_from_directory( $file, $directory ) { |
6008 | | $real_file = realpath( wp_normalize_path( $file ) ); |
6009 | | $real_directory = realpath( wp_normalize_path( $directory ) ); |
| 6016 | if ( wp_is_stream($file) ) { |
| 6017 | $real_file = wp_normalize_path( $file ); |
| 6018 | $real_directory = wp_normalize_path( $directory ); |
| 6019 | } else { |
| 6020 | $real_file = realpath( wp_normalize_path( $file ) ); |
| 6021 | $real_directory = realpath ( wp_normalize_path( $directory ) ); |
| 6022 | } |
6010 | 6023 | |
6011 | | if ( false === $real_file || false === $real_directory || strpos( wp_normalize_path( $real_file ), trailingslashit( wp_normalize_path( $real_directory ) ) ) !== 0 ) { |
| 6024 | if ( false === $real_file || false === $real_directory || strpos( $real_file, trailingslashit( $real_directory ) ) !== 0 ) { |
6012 | 6025 | return false; |
6013 | 6026 | } |
6014 | 6027 | |