From b62d2130001d79cec25d6304adab80710756ac69 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sun, 17 Mar 2019 18:21:57 +0100 Subject: [PATCH] Fix invalid ftp login --- System/File/Ftp/Directory.php | 4 ++++ System/File/Ftp/File.php | 4 ++++ 2 files changed, 8 insertions(+) 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() !== '') {