Ok so after a bit of research and breakpoint debugging, I found out where the problem lies.
This function inside laravel\vendor\league\flysystem\src\Util\ContentListingFormatter.php is what cause the case sensitivity problem:
private function isDirectChild(array $entry)
{
return Util::dirname($entry['path']) === $this->directory;
}
this check if the entry is child of the directory but it uses case sensitive comparison, which is wrong in out case cause Dropbox is case insensitive, and the listFolder call returns wrong case on non-last folders.
I fixed editing the function to compare strings ignoring case as it follows:
I know this is not a problem related to the spatie/flysystem-dropbox package itself, but it could be useful for it to override that function to prevent this kind of unwanted behaviours.
Ok so after a bit of research and breakpoint debugging, I found out where the problem lies. This function inside
laravel\vendor\league\flysystem\src\Util\ContentListingFormatter.php
is what cause the case sensitivity problem:this check if the entry is child of the directory but it uses case sensitive comparison, which is wrong in out case cause Dropbox is case insensitive, and the listFolder call returns wrong case on non-last folders.
I fixed editing the function to compare strings ignoring case as it follows:
I know this is not a problem related to the spatie/flysystem-dropbox package itself, but it could be useful for it to override that function to prevent this kind of unwanted behaviours.
Hope this helps.