From 9e458d8fe890322a2e2e5cc3cf77026eaba88d7c Mon Sep 17 00:00:00 2001 From: "Eloy Lafuente (stronk7)" Date: Sat, 26 Oct 2019 17:05:29 +0200 Subject: [PATCH] MDL-67031 s3: php74 fixup for class S3 v0.5.1 --- repository/s3/README_MOODLE.txt | 6 ++++++ repository/s3/S3.php | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/repository/s3/README_MOODLE.txt b/repository/s3/README_MOODLE.txt index 4f44dc36d9a..de664ce03a3 100644 --- a/repository/s3/README_MOODLE.txt +++ b/repository/s3/README_MOODLE.txt @@ -6,3 +6,9 @@ Cloned from git://github.com/tpyo/amazon-s3-php-class.git https://github.com/tpyo/amazon-s3-php-class http://undesigned.org.za/2007/10/22/amazon-s3-php-class + +Local changes applied: +(verify on each upgrade of the library if they have been applied +upstream. Remove the local changes if so) + +MDL-67031 php74 compliance. Change curly to square braces. diff --git a/repository/s3/S3.php b/repository/s3/S3.php index d8048c799dd..631aba3719e 100644 --- a/repository/s3/S3.php +++ b/repository/s3/S3.php @@ -2354,7 +2354,7 @@ final class S3Request elseif ($header == 'Content-Type') $this->response->headers['type'] = $value; elseif ($header == 'ETag') - $this->response->headers['hash'] = $value{0} == '"' ? substr($value, 1, -1) : $value; + $this->response->headers['hash'] = $value[0] == '"' ? substr($value, 1, -1) : $value; elseif (preg_match('/^x-amz-meta-.*$/', $header)) $this->response->headers[$header] = $value; }