Page MenuHomePhabricator

D10264.id24713.diff
No OneTemporary

D10264.id24713.diff

diff --git a/src/applications/files/controller/PhabricatorFileInfoController.php b/src/applications/files/controller/PhabricatorFileInfoController.php
--- a/src/applications/files/controller/PhabricatorFileInfoController.php
+++ b/src/applications/files/controller/PhabricatorFileInfoController.php
@@ -213,9 +213,17 @@
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'));
diff --git a/src/applications/files/storage/PhabricatorFile.php b/src/applications/files/storage/PhabricatorFile.php
--- a/src/applications/files/storage/PhabricatorFile.php
+++ b/src/applications/files/storage/PhabricatorFile.php
@@ -28,7 +28,7 @@
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 @@
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);
}

File Metadata

Mime Type
text/plain
Expires
May 18 2024, 9:39 PM (6 w, 10 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6283891
Default Alt Text
D10264.id24713.diff (1 KB)

Event Timeline