Changeset 35944
- Timestamp:
- 12/15/2015 02:35:26 AM (9 years ago)
- Location:
- trunk/src/wp-admin/includes
- Files:
-
- 2 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 -
trunk/src/wp-admin/includes/class-wp-filesystem-ftpsockets.php
r35942 r35944 343 343 */ 344 344 public function exists( $file ) { 345 $list = $this->ftp-> rawlist( $file, '-a');345 $list = $this->ftp->nlist( $file ); 346 346 347 347 if ( empty( $list ) && $this->is_dir( $file ) ) {
Note: See TracChangeset
for help on using the changeset viewer.