Changeset 48369
- Timestamp:
- 07/07/2020 10:18:25 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/functions.php
r48368 r48369 2534 2534 // The (resized) image files would have name and extension, and will be in the uploads dir. 2535 2535 if ( $name && $ext && @is_dir( $dir ) && false !== strpos( $dir, $upload_dir['basedir'] ) ) { 2536 // List of all files and directories contained in $dir. 2537 $files = @scandir( $dir ); 2536 /** 2537 * Filters the file list used for calculating a unique filename for a newly added file. 2538 * 2539 * Returning an array from the filter will effectively short-circuit retrieval 2540 * from the filesystem and return the passed value instead. 2541 * 2542 * @since 5.5.0 2543 * 2544 * @param array|null $files The list of files to use for filename comparisons. 2545 * Default null (to retrieve the list from the filesystem). 2546 * @param string $dir The directory for the new file. 2547 * @param string $filename The proposed filename for the new file. 2548 */ 2549 $files = apply_filters( 'pre_wp_unique_filename_file_list', null, $dir, $filename ); 2550 2551 if ( null === $files ) { 2552 // List of all files and directories contained in $dir. 2553 $files = @scandir( $dir ); 2554 } 2538 2555 2539 2556 if ( ! empty( $files ) ) {
Note: See TracChangeset
for help on using the changeset viewer.