- Timestamp:
- 10/01/2015 05:08:07 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-filesystem-ftpext.php
r34493 r34733 317 317 * @return bool 318 318 */ 319 public function exists($file) { 320 $list = @ftp_rawlist( $this->link, '-a ' . $file ); 321 322 if ( empty( $list ) && $this->is_dir( $file ) ) { 323 return true; // File is an empty directory. 324 } 325 326 return !empty($list); //empty list = no file, so invert. 319 public function exists( $file ) { 320 $path = dirname( $file ); 321 $filename = basename( $file ); 322 323 $file_list = @ftp_nlist( $this->link, '-a ' . $path ); 324 if ( $file_list ) { 325 $file_list = array_map( 'basename', $file_list ); 326 } 327 328 return $file_list && in_array( $filename, $file_list ); 327 329 } 328 330
Note: See TracChangeset
for help on using the changeset viewer.