diff --git a/src/wp-admin/includes/class-wp-filesystem-ftpext.php b/src/wp-admin/includes/class-wp-filesystem-ftpext.php
index 627128fcac..48eed3b4a3 100644
a
|
b
|
class WP_Filesystem_FTPext extends WP_Filesystem_Base { |
412 | 412 | * Checks if a file or directory exists. |
413 | 413 | * |
414 | 414 | * @since 2.5.0 |
| 415 | * @since 6.0.0 returns false for empty filepath |
415 | 416 | * |
416 | 417 | * @param string $file Path to file or directory. |
417 | 418 | * @return bool Whether $file exists or not. |
418 | 419 | */ |
419 | 420 | public function exists( $file ) { |
| 421 | |
| 422 | /** |
| 423 | * Check for empty filepath. If ftp_nlist gets an empty path, |
| 424 | * it checks the current working dir and may return true here. |
| 425 | * |
| 426 | * @ticket 33058 |
| 427 | */ |
| 428 | if ( empty( $file ) ) { |
| 429 | return false; |
| 430 | } |
| 431 | |
420 | 432 | $list = ftp_nlist( $this->link, $file ); |
421 | 433 | |
422 | 434 | if ( empty( $list ) && $this->is_dir( $file ) ) { |