thephpleague / flysystem-sftp

[READ-ONLY SUBSPLIT] Flysystem Adapter for SFTP

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PathPrefix is ignored

SamMousa opened this issue · comments

It seems this adapter fully ignores a configured path prefix.

Correct, I saw it last week. I've got it on my list for Friday. If you need it sooner a PR is welcome (with tests).

Side note, the option is not really documented. Is path prefix supposed to be a guarantee from a security perspective?

The path prefix is to facilitate scoping, which is not provided now but will be when implemented. Path traversal prevention is done at a different level, the path passed to the Filesystem instance is checked for this.

Alternative fix would be to have another look at my old PR for a decorator: thephpleague/flysystem#799.

The approach of a decorator is cleaner, more secure and will work for any adapter not the ones that happen to implement it.