1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-10 08:52:39 +01:00

Fix cancdn vs canCDN flag

Summary:
Ref T5884. We migrated to add a `canCDN` flag, but the code looks for a `cancdn` flag.

If this fixes the issue, I'll migrate `cancdn` to `canCDN` in the next diff.

Test Plan: Viewed some files, including old files, and saw the cacheability I expected.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T5884

Differential Revision: https://secure.phabricator.com/D10264
This commit is contained in:
epriestley 2014-08-14 12:13:26 -07:00
parent 6669fe9e8a
commit ae1a821b65
2 changed files with 18 additions and 4 deletions

View file

@ -213,9 +213,17 @@ final class PhabricatorFileInfoController extends PhabricatorFileController {
pht('%s px', new PhutilNumber($height)));
}
$finfo->addProperty(
pht('Cacheable'),
$file->getCanCDN() ? pht('Yes') : pht('No'));
$is_image = $file->isViewableImage();
if ($is_image) {
$image_string = pht('Yes');
$cache_string = $file->getCanCDN() ? pht('Yes') : pht('No');
} else {
$image_string = pht('No');
$cache_string = pht('Not Applicable');
}
$finfo->addProperty(pht('Viewable Image'), $image_string);
$finfo->addProperty(pht('Cacheable'), $cache_string);
$storage_properties = new PHUIPropertyListView();
$box->addPropertyList($storage_properties, pht('Storage'));

View file

@ -28,7 +28,7 @@ final class PhabricatorFile extends PhabricatorFileDAO
const METADATA_IMAGE_WIDTH = 'width';
const METADATA_IMAGE_HEIGHT = 'height';
const METADATA_CAN_CDN = 'cancdn';
const METADATA_CAN_CDN = 'canCDN';
protected $name;
protected $mimeType;
@ -848,6 +848,12 @@ final class PhabricatorFile extends PhabricatorFileDAO
if (!$this->isViewableImage()) {
return false;
}
// TODO: Migrate away this old constant and remove this check.
if (idx($this->metadata, 'cancdn')) {
return true;
}
return idx($this->metadata, self::METADATA_CAN_CDN);
}