Changeset 45177
- Timestamp:
- 04/12/2019 08:00:42 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/functions.php
r45137 r45177 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 … … 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 ) ); 6274 6275 if ( false === $real_file || false === $real_directory || strpos( wp_normalize_path( $real_file ), trailingslashit( wp_normalize_path( $real_directory ) ) ) !== 0 ) { 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 } 6287 6288 if ( false === $real_file || false === $real_directory || strpos( $real_file, trailingslashit( $real_directory ) ) !== 0 ) { 6276 6289 return false; 6277 6290 }
Note: See TracChangeset
for help on using the changeset viewer.