mirror of
https://github.com/PrivateBin/PrivateBin.git
synced 2024-03-22 13:10:41 +08:00
Fix GCS Upload Metadata Mistake
This commit is contained in:
parent
8dded4e8e4
commit
8dbe60621d
|
@ -112,13 +112,18 @@ class GoogleCloudStorage extends AbstractData
|
||||||
*/
|
*/
|
||||||
private function _upload($key, $payload)
|
private function _upload($key, $payload)
|
||||||
{
|
{
|
||||||
|
$metadata = array_key_exists('meta', $payload) ? $payload['meta'] : array();
|
||||||
|
unset($metadata['attachment'], $metadata['attachmentname'], $metadata['salt']);
|
||||||
|
foreach ($metadata as $k => $v) {
|
||||||
|
$metadata[$k] = strval($v);
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
$data = array(
|
$data = array(
|
||||||
'name' => $key,
|
'name' => $key,
|
||||||
'chunkSize' => 262144,
|
'chunkSize' => 262144,
|
||||||
'metadata' => array(
|
'metadata' => array(
|
||||||
'content-type' => 'application/json',
|
'content-type' => 'application/json',
|
||||||
'metadata' => $payload,
|
'metadata' => $metadata,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
if (!self::$_uniformacl) {
|
if (!self::$_uniformacl) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user