Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for the isDir function in the FTP Adapter #607

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open
7 changes: 6 additions & 1 deletion src/Gaufrette/Adapter/Ftp.php
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,12 @@ private function isDir($directory)
return true;
}

if (!@ftp_chdir($this->getConnection(), $directory)) {
nicolasmure marked this conversation as resolved.
Show resolved Hide resolved
// Build the FTP URL that will be used to check if the path is a directory or not
$url = $this->ssl ? 'sftp://' : 'ftp://';
$url .= $this->username . ':' . $this->password . '@' . $this->host;
$url .= $this->port ? ':' . $this->port : '';

if (!@is_dir($url . $directory)) {
return false;
}

Expand Down