- Timestamp:
- 08/08/2022 12:39:51 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-filesystem-ftpext.php
r53714 r53860 413 413 * 414 414 * @since 2.5.0 415 * @since 6.1.0 Rewrite using ftp_rawlist, uses 'LIST' on FTP server 416 * takes file path or directory path as parameter. 415 417 * 416 418 * @param string $file Path to file or directory. … … 418 420 */ 419 421 public function exists( $file ) { 420 $list = ftp_nlist( $this->link, $file ); 421 422 if ( empty( $list ) && $this->is_dir( $file ) ) { 423 return true; // File is an empty directory. 424 } 425 426 return ! empty( $list ); // Empty list = no file, so invert. 422 if ( $this->is_dir( $file ) ) { 423 return true; 424 } 425 426 return ! empty( ftp_rawlist( $this->link, $file ) ); 427 427 } 428 428 … … 511 511 * 512 512 * @since 2.5.0 513 * @since 6.1.0 Update for proper return values. 513 514 * 514 515 * @param string $file Path to file. 515 * @return int |false Size of the file in bytes on success, falseon failure.516 * @return int Size of the file in bytes on success, -1 on failure. 516 517 */ 517 518 public function size( $file ) {
Note: See TracChangeset
for help on using the changeset viewer.