- Timestamp:
- 11/11/2022 04:02:41 PM (2 years ago)
- Location:
- branches/6.1
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/6.1
-
branches/6.1/src/wp-admin/includes/class-wp-filesystem-ftpext.php
r53898 r54816 413 413 * 414 414 * @since 2.5.0 415 * @since 6.1.0 Uses WP_Filesystem_FTPext::is_dir() to check for directory existence416 * and ftp_rawlist() to check for file existence.417 415 * 418 416 * @param string $path Path to file or directory. … … 420 418 */ 421 419 public function exists( $path ) { 422 if ( $this->is_dir( $path ) ) { 423 return true; 424 } 425 426 return ! empty( ftp_rawlist( $this->link, $path ) ); 420 $list = ftp_nlist( $this->link, $path ); 421 422 if ( empty( $list ) && $this->is_dir( $path ) ) { 423 return true; // File is an empty directory. 424 } 425 426 return ! empty( $list ); // Empty list = no file, so invert. 427 427 } 428 428
Note: See TracChangeset
for help on using the changeset viewer.