From 539156265e46d175828bcaa8832e3ac7245fd29f Mon Sep 17 00:00:00 2001
From: Gareth Alexander <gareth.alexander@cyber-duck.co.uk>
Date: Thu, 6 Apr 2023 15:54:40 +0100
Subject: [PATCH] Issue #3352665: Return S3 Versioning as a Configurable
 Option.

---
 src/StreamWrapper/S3fsStream.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/StreamWrapper/S3fsStream.php b/src/StreamWrapper/S3fsStream.php
index 55dc1d6..518ee03 100644
--- a/src/StreamWrapper/S3fsStream.php
+++ b/src/StreamWrapper/S3fsStream.php
@@ -506,7 +506,7 @@ class S3fsStream extends StreamWrapper implements StreamWrapperInterface {
     // If this file is versioned, attach the version number to
     // ensure that browser caches will be bypassed upon version changes.
     $meta = $this->readCache($this->uri);
-    if (!empty($meta['version'])) {
+    if (!empty($meta['version']) && !empty($this->config['use_versioning'])) {
       $commandSettings['VersionId'] = $meta['version'];
     }
 
-- 
GitLab