Skip to content
This repository has been archived by the owner on Jan 27, 2024. It is now read-only.

fix listContents() for subdirectories if parent is uppercase #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Schlaefer
Copy link

Let's say we have file Foo/bar/baz.txt on dropbox. Then

$adapter = new DropboxAdapter(…);
$filesystem = new Filesystem($adapter);
$filesystem->listContents('Foo/bar');

returns an empty array.

The problem is that the dropbox API returns the path as lowercase: foo/bar. League\Flysystem::listContents() then filters the content out because it compares 'Foo/bar' to 'foo/bar'.

@frankdejonge
Copy link
Member

@basz I think this is related.

Shouldn't the entire path be lowercased? What reason is there to only lowercase everything from the first parent directory?

@basz
Copy link

basz commented Mar 17, 2015

I don't have my 'finger behind it' completely yet. I am having troubles with a unix and osx environment which handles cases differently.

But I think that the mapper callback in https://github.com/thephpleague/flysystem/blob/master/src/Filesystem.php#L355 should be aware of the case sensitivity of the adapter.

I have an dropbox app in which I get mixed results for a prefixed path and a path without the prefix set. Confusing...

@Schlaefer
Copy link
Author

From what I've seen so far the last part of the path (basename) is always case sensitive. Everything else esp. on longer paths gets lowercased. So when querying down the path tree preserving the then basename part in every step should hopefully result in a complete case preserved path.

See here first comment.

But I think that the mapper callback in https://github.com/thephpleague/flysystem/blob/master/src/Filesystem.php#L355 should be aware of the case sensitivity of the adapter.

👍

@freekmurze
Copy link

I'm having the same problem at spatie/flysystem-dropbox too. If somebody knows a good solution for this problem, I'd highly appreciate a clean well-tested fix for this problem.

Copy link

@davemin davemin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not always ok,not working on last ver.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants