Changeset 35945
- Timestamp:
- 12/15/2015 02:36:59 AM (9 years ago)
- Location:
- branches/4.4
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/4.4
-
branches/4.4/src/wp-admin/includes/class-wp-filesystem-ftpext.php
r35663 r35945 327 327 * @return bool 328 328 */ 329 public function exists( $file ) { 330 $path = dirname( $file ); 331 $filename = basename( $file ); 332 333 $file_list = @ftp_nlist( $this->link, '-a ' . $path ); 334 if ( $file_list ) { 335 $file_list = array_map( 'basename', $file_list ); 336 } 337 338 return $file_list && in_array( $filename, $file_list ); 329 public function exists($file) { 330 $list = @ftp_nlist($this->link, $file); 331 332 if ( empty( $list ) && $this->is_dir( $file ) ) { 333 return true; // File is an empty directory. 334 } 335 336 return !empty($list); //empty list = no file, so invert. 339 337 } 340 338 -
branches/4.4/src/wp-admin/includes/class-wp-filesystem-ftpsockets.php
r35664 r35945 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.