@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Correct two parameter strictness issues with file uploads

Summary:
Fixes T12531. Strictness fallout from adding typechecking in D17616.

- `chunkedHash` is not a real parameter, so the new typechecking was unhappy about it.
- `mime-type` no longer allows `null`.

Test Plan:
- Ran `arc upload --conduit-uri ... 12MB.zero` on a 12MB file full of zeroes.
- Before patch: badness, failure, fallback to one-shot uploads.
- After patch: success and glory.

Reviewers: chad

Subscribers: joshuaspence

Maniphest Tasks: T12531

Differential Revision: https://secure.phabricator.com/D17651

+15 -5
+10 -5
src/applications/files/conduit/FileUploadChunkConduitAPIMethod.php
··· 61 61 $mime_type = 'application/octet-stream'; 62 62 } 63 63 64 + $params = array( 65 + 'name' => $file->getMonogram().'.chunk-'.$chunk->getID(), 66 + 'viewPolicy' => PhabricatorPolicies::POLICY_NOONE, 67 + ); 68 + 69 + if ($mime_type !== null) { 70 + $params['mime-type'] = 'application/octet-stream'; 71 + } 72 + 64 73 // NOTE: These files have a view policy which prevents normal access. They 65 74 // are only accessed through the storage engine. 66 75 $chunk_data = PhabricatorFile::newFromFileData( 67 76 $data, 68 - array( 69 - 'name' => $file->getMonogram().'.chunk-'.$chunk->getID(), 70 - 'viewPolicy' => PhabricatorPolicies::POLICY_NOONE, 71 - 'mime-type' => $mime_type, 72 - )); 77 + $params); 73 78 74 79 $chunk->setDataFilePHID($chunk_data->getPHID())->save(); 75 80
+5
src/applications/files/storage/PhabricatorFile.php
··· 251 251 $file->setMimeType('application/octet-stream'); 252 252 253 253 $chunked_hash = idx($params, 'chunkedHash'); 254 + 255 + // Get rid of this parameter now; we aren't passing it any further down 256 + // the stack. 257 + unset($params['chunkedHash']); 258 + 254 259 if ($chunked_hash) { 255 260 $file->setContentHash($chunked_hash); 256 261 } else {