thephpleague / flysystem-sftp

[READ-ONLY SUBSPLIT] Flysystem Adapter for SFTP

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`Invalid argument supplied for foreach()` in SftpAdapter when calling `listContents`

dmaicher opened this issue · comments

I'm using version 2.0.5 and I have an issue when I want to list directory contents with a path that does not exist on the server.

Basically this call returns false: https://github.com/thephpleague/flysystem-sftp/blob/2.x/SftpAdapter.php#L258

Which can happen in some cases: https://github.com/phpseclib/phpseclib/blob/master/phpseclib/Net/SFTP.php#L849

So we end up iterating over false which fails.

Reported here instead: thephpleague/flysystem#1300