- Timestamp:
- 12/15/2015 02:35:26 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-filesystem-ftpext.php
r35777 r35944 332 332 * @return bool 333 333 */ 334 public function exists( $file ) { 335 $path = dirname( $file ); 336 $filename = basename( $file ); 337 338 $file_list = @ftp_nlist( $this->link, '-a ' . $path ); 339 if ( $file_list ) { 340 $file_list = array_map( 'basename', $file_list ); 341 } 342 343 return $file_list && in_array( $filename, $file_list ); 334 public function exists($file) { 335 $list = @ftp_nlist($this->link, $file); 336 337 if ( empty( $list ) && $this->is_dir( $file ) ) { 338 return true; // File is an empty directory. 339 } 340 341 return !empty($list); //empty list = no file, so invert. 344 342 } 345 343
Note: See TracChangeset
for help on using the changeset viewer.