ftpRawlist method forces the path to end with slash, however on some ftp servers it breaks things. If I manually set set $path variable to "/foo" I'm getting the correct list of files, if I set it to "/foo/" - I get empty list.
The FTP server that is causing the problem is called Qnap. My suggestion would be to not add the ending slash (or actually forcing it to be removed, unless it's just / path), however I'm not sure if that won't break other servers, so maybe better solution would be to add an option to FtpConnectionOptions to specify whether slash should be added or removed in ftpRawlist method.
From what I've checked removing the slash didn't break other functionalities like getting the contents of the file etc
How to reproduce
private function ftpRawlist(string $options, string $path): array
{
$path = rtrim($path, '/') . '/';
// uncomment one of the lines below
// $path = '/foo';
// $oath = '/foo/';
$connection = $this->connection();
Bug Report
Summary
ftpRawlist
method forces the path to end with slash, however on some ftp servers it breaks things. If I manually set set$path
variable to"/foo"
I'm getting the correct list of files, if I set it to"/foo/"
- I get empty list.The FTP server that is causing the problem is called
Qnap
. My suggestion would be to not add the ending slash (or actually forcing it to be removed, unless it's just/
path), however I'm not sure if that won't break other servers, so maybe better solution would be to add an option toFtpConnectionOptions
to specify whether slash should be added or removed inftpRawlist
method.From what I've checked removing the slash didn't break other functionalities like getting the contents of the file etc
How to reproduce