spatie / flysystem-dropbox

A flysystem driver for Dropbox that uses the v2 API
https://freek.dev/734-dropbox-will-turn-off-v1-of-their-api-soon-its-time-to-update-your-php-application
MIT License
343 stars 50 forks source link

Workaround for case issue Dropbox. #37

Closed ruudvdd closed 5 years ago

ruudvdd commented 6 years ago

This is a workaround for https://www.dropboxforum.com/t5/API-Support-Feedback/APIV1-ListDirectory-lowercase-issue/td-p/210931

Sometimes Dropbox API returns the lowercase path in the path_display of all files and directories in a response. Because the check at \League\Flysystem\Util\ContentListingFormatter::isDirectChild is case sensitive it won't return those files or dirs.

This pr will always return the lowercase path (path_lower) as value of the path key, but will also include the path_display (which is inconsistently lowercase or uppercase) and the name (which has always the correct casing) of the dropbox result respectively as the value of the path_display key and the name key.

This pr is a breaking change in my opinion because it now expects the dev to always pass the lowercase path as the directory argument of the Filesystem::listContents method.

freekmurze commented 5 years ago

This will be fixed in an upcoming release of Flysystem (see https://github.com/thephpleague/flysystem/pull/987)