diff --git src/wp-includes/functions.php src/wp-includes/functions.php
index 6a30a598c3..32a39f002a 100644
|
|
function wp_mkdir_p( $target ) { |
1830 | 1830 | * @return bool True if path is absolute, false is not absolute. |
1831 | 1831 | */ |
1832 | 1832 | function path_is_absolute( $path ) { |
| 1833 | /* |
| 1834 | * Check to see if the path is a stream and check to see if its an actual |
| 1835 | * path or file as realpath() does not support stream wrappers. |
| 1836 | */ |
| 1837 | if ( wp_is_stream( $path ) && ( is_dir( $path ) || is_file( $path ) ) ) { |
| 1838 | return true; |
| 1839 | } |
| 1840 | |
1833 | 1841 | /* |
1834 | 1842 | * This is definitive if true but fails if $path does not exist or contains |
1835 | 1843 | * a symbolic link. |
… |
… |
function wp_delete_file( $file ) { |
6269 | 6277 | * @return bool True on success, false on failure. |
6270 | 6278 | */ |
6271 | 6279 | function wp_delete_file_from_directory( $file, $directory ) { |
6272 | | $real_file = realpath( wp_normalize_path( $file ) ); |
6273 | | $real_directory = realpath( wp_normalize_path( $directory ) ); |
| 6280 | if ( wp_is_stream( $file ) ) { |
| 6281 | $real_file = wp_normalize_path( $file ); |
| 6282 | $real_directory = wp_normalize_path( $directory ); |
| 6283 | } else { |
| 6284 | $real_file = realpath( wp_normalize_path( $file ) ); |
| 6285 | $real_directory = realpath ( wp_normalize_path( $directory ) ); |
| 6286 | } |
6274 | 6287 | |
6275 | | if ( false === $real_file || false === $real_directory || strpos( wp_normalize_path( $real_file ), trailingslashit( wp_normalize_path( $real_directory ) ) ) !== 0 ) { |
| 6288 | if ( false === $real_file || false === $real_directory || strpos( $real_file, trailingslashit( $real_directory ) ) !== 0 ) { |
6276 | 6289 | return false; |
6277 | 6290 | } |
6278 | 6291 | |