diff --git a/wp-includes/functions.php b/wp-includes/functions.php
index 5802a34146..626d59f455 100644
|
a
|
b
|
function wp_mkdir_p( $target ) { |
| 1656 | 1656 | * @return bool True if path is absolute, false is not absolute. |
| 1657 | 1657 | */ |
| 1658 | 1658 | function path_is_absolute( $path ) { |
| | 1659 | /* |
| | 1660 | * Check to see if the path is a stream and check to see if its an actual |
| | 1661 | * path or file as realpath() does not support streamwrappers. |
| | 1662 | */ |
| | 1663 | if (wp_is_stream($path) && (is_dir($path) || is_file($path))) { |
| | 1664 | return true; |
| | 1665 | } |
| | 1666 | |
| 1659 | 1667 | /* |
| 1660 | 1668 | * This is definitive if true but fails if $path does not exist or contains |
| 1661 | 1669 | * a symbolic link. |
| … |
… |
function wp_delete_file( $file ) { |
| 5526 | 5534 | * @return bool True on success, false on failure. |
| 5527 | 5535 | */ |
| 5528 | 5536 | function wp_delete_file_from_directory( $file, $directory ) { |
| 5529 | | $real_file = realpath( wp_normalize_path( $file ) ); |
| 5530 | | $real_directory = realpath( wp_normalize_path( $directory ) ); |
| | 5537 | if ( wp_is_stream($file) ) { |
| | 5538 | $real_file = wp_normalize_path($file); |
| | 5539 | $real_directory = wp_normalize_path($directory); |
| | 5540 | } else { |
| | 5541 | $real_file = realpath( wp_normalize_path($file) ); |
| | 5542 | $real_directory = realpath ( wp_normalize_path($directory) ); |
| | 5543 | } |
| 5531 | 5544 | |
| 5532 | | if ( false === $real_file || false === $real_directory || strpos( wp_normalize_path( $real_file ), trailingslashit( wp_normalize_path( $real_directory ) ) ) !== 0 ) { |
| | 5545 | if ( false === $real_file || false === $real_directory || strpos( $real_file, trailingslashit( $real_directory ) ) !== 0 ) { |
| 5533 | 5546 | return false; |
| 5534 | 5547 | } |
| 5535 | 5548 | |