File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
lib/private/Files/ObjectStore Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -100,6 +100,9 @@ private function parseS3Metadata(array $metadata): array {
100100 $ result = [];
101101 foreach ($ metadata as $ key => $ value ) {
102102 if (str_starts_with ($ key , 'x-amz-meta- ' )) {
103+ if (str_starts_with ($ value , 'base64: ' )) {
104+ $ value = base64_decode (substr ($ value , 7 ));
105+ }
103106 $ result [substr ($ key , strlen ('x-amz-meta- ' ))] = $ value ;
104107 }
105108 }
Original file line number Diff line number Diff line change @@ -82,7 +82,11 @@ public function readObject($urn) {
8282 private function buildS3Metadata (array $ metadata ): array {
8383 $ result = [];
8484 foreach ($ metadata as $ key => $ value ) {
85- $ result ['x-amz-meta- ' . $ key ] = $ value ;
85+ if (mb_check_encoding ($ value , 'ASCII ' )) {
86+ $ result ['x-amz-meta- ' . $ key ] = $ value ;
87+ } else {
88+ $ result ['x-amz-meta- ' . $ key ] = 'base64: ' . base64_encode ($ value );
89+ }
8690 }
8791 return $ result ;
8892 }
You can’t perform that action at this time.
0 commit comments