From 3a9078709140aa5e0a07eb9e636106adc51733e8 Mon Sep 17 00:00:00 2001 From: Chris Date: Sat, 11 Jan 2020 02:40:11 +0100 Subject: [PATCH] use passive mode by default --- storage-controllers/ftp.controller.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/storage-controllers/ftp.controller.php b/storage-controllers/ftp.controller.php index 2d3e399..12fe7b7 100644 --- a/storage-controllers/ftp.controller.php +++ b/storage-controllers/ftp.controller.php @@ -16,7 +16,10 @@ class FTPStorage implements StorageController if(!$this->connection) $this->connection = ftp_connect(FTP_SERVER); if(!$this->login) + { $this->login = ftp_login($this->connection, FTP_USER, FTP_PASS); + ftp_pasv($this->connection, TRUE); + } // Was the connection successful? if ((!$this->connection) || (!$this->login)) { @@ -46,7 +49,6 @@ class FTPStorage implements StorageController function getItems($dev=false) { if(!$this->connect()) return false; - ftp_pasv($this->connection, TRUE); return $this->ftp_list_files_recursive(FTP_BASEDIR); }