diff --git src/wp-admin/includes/class-wp-filesystem-ftpext.php src/wp-admin/includes/class-wp-filesystem-ftpext.php
index 038d8468ce..da748e94a1 100644
|
|
class WP_Filesystem_FTPext extends WP_Filesystem_Base { |
227 | 227 | * @return string|false The current working directory on success, false on failure. |
228 | 228 | */ |
229 | 229 | public function cwd() { |
| 230 | if ( is_null( $this->link ) ) { |
| 231 | return false; |
| 232 | } |
230 | 233 | $cwd = ftp_pwd( $this->link ); |
231 | 234 | |
232 | 235 | if ( $cwd ) { |
… |
… |
class WP_Filesystem_FTPext extends WP_Filesystem_Base { |
417 | 420 | * @return bool Whether $file exists or not. |
418 | 421 | */ |
419 | 422 | public function exists( $file ) { |
| 423 | if ( is_null( $this->link ) ) { |
| 424 | return false; |
| 425 | } |
420 | 426 | $list = ftp_nlist( $this->link, $file ); |
421 | 427 | |
422 | 428 | if ( empty( $list ) && $this->is_dir( $file ) ) { |
… |
… |
class WP_Filesystem_FTPext extends WP_Filesystem_Base { |
447 | 453 | * @return bool Whether $path is a directory. |
448 | 454 | */ |
449 | 455 | public function is_dir( $path ) { |
| 456 | if ( is_null( $this->link ) ) { |
| 457 | return false; |
| 458 | } |
450 | 459 | $cwd = $this->cwd(); |
451 | 460 | $result = @ftp_chdir( $this->link, trailingslashit( $path ) ); |
452 | 461 | |
… |
… |
class WP_Filesystem_FTPext extends WP_Filesystem_Base { |
714 | 723 | $limit_file = false; |
715 | 724 | } |
716 | 725 | |
| 726 | if ( is_null( $this->link ) ){ |
| 727 | return false; |
| 728 | } |
| 729 | |
717 | 730 | $pwd = ftp_pwd( $this->link ); |
718 | 731 | |
719 | 732 | if ( ! @ftp_chdir( $this->link, $path ) ) { // Can't change to folder = folder doesn't exist. |