Summary: See D15828 - arc is reporting file size as `0` for unexisting files - make it stop.
Test Plan: `arc diff` with empty, deleted, added files - see size reported as `null` when appropriate.
Reviewers: epriestley, #blessed_reviewers
Reviewed By: epriestley, #blessed_reviewers
Subscribers: chad, Korvin
Differential Revision: https://secure.phabricator.com/D16059
foreach ($need_upload as $key => $spec) {
$change = $need_upload[$key]['change'];
- $type = $spec['type'];
- $size = strlen($spec['data']);
-
- $change->setMetadata("{$type}:file:size", $size);
if ($spec['data'] === null) {
// This covers the case where a file was added or removed; we don't
// need to upload the other half of it (e.g., the old file data for
continue;
}
+ $type = $spec['type'];
+ $size = strlen($spec['data']);
+
+ $change->setMetadata("{$type}:file:size", $size);
+
$mime = $this->getFileMimeType($spec['data']);
if (preg_match('@^image/@', $mime)) {
$change->setFileType($type_image);