diff --git a/System/File/Ftp/Directory.php b/System/File/Ftp/Directory.php index 9bb03a3ad..07737ab38 100644 --- a/System/File/Ftp/Directory.php +++ b/System/File/Ftp/Directory.php @@ -55,6 +55,10 @@ class Directory extends FileAbstract implements FtpContainerInterface, Directory { $con = \ftp_connect($http->getHost(), $http->getPort()); + if ($con === false) { + return false; + } + \ftp_login($con, $http->getUser(), $http->getPass()); if ($http->getPath() !== '') { diff --git a/System/File/Ftp/File.php b/System/File/Ftp/File.php index 4e32abe69..ef4092992 100644 --- a/System/File/Ftp/File.php +++ b/System/File/Ftp/File.php @@ -71,6 +71,10 @@ class File extends FileAbstract implements FileInterface { $con = \ftp_connect($http->getHost(), $http->getPort()); + if ($con === false) { + return false; + } + \ftp_login($con, $http->getUser(), $http->getPass()); if ($http->getPath() !== '') {