Skip to content

Flysystem V2/V3: Security fixes v2.6.0

Choose a tag to compare

@masbug masbug released this 10 Nov 13:05

Security

  • The minimum versions of the dependencies now exclude all releases with a known security advisory (14 Dependabot alerts):
    • guzzlehttp/guzzle ^7.15.2 or ^8.0.1
    • guzzlehttp/psr7 ^2.12.3 or ^3.0
    • league/flysystem ^3.35.3
    • google/apiclient ^2.19
  • readStream() sends the access token and the cookies only to Google hosts. Before, each redirect host received the token.
  • File names in Google Drive queries are escaped (option useSinglePathTransaction).

Requirements

  • PHP 8.1 or later. The source already needed PHP 8.0.
  • Guzzle 6, PSR-7 1.x and Flysystem 2 are not supported anymore, because these lines have no patched release. For Flysystem 2, stay on v2.5.0.
  • Guzzle 8 and PSR-7 3 are supported.

Fixes

  • Metadata of a shortcut caused a fatal error.
  • copy() and move() failed when the object cache did not contain the source file.
  • hasDir() failed for a path that does not exist.
  • UnableToWriteFile now has the original error as its cause.
  • Resumable uploads send content-length only when the size of the body is known.

Changes

  • The adapter sets 3 retries on the Google client for temporary errors (HTTP 500, HTTP 503, rate limit, connection failure). An application that sets the retry configuration of the client keeps its own value. To have no retries, call $client->setConfig('retry', ['retries' => 0]) before you create the adapter.
  • The integration tests read google-drive-service-account.json from the directory that contains the project directory, or from the path in the environment variable GOOGLE_DRIVE_SERVICE_ACCOUNT_FILE.

Pull requests

  • Update Guzzle and PSR7 version constraints by @erikn69 in #145

Parts of the security fixes and the other fixes are based on #142 by tarikmanoar.

Full Changelog: v2.5.0...v2.6.0