mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-22 21:40:55 +01:00
realized should probably wrap this in idx... and i haven't cowboy committed in a bit. :P
This commit is contained in:
parent
ad29c98610
commit
c046aa64c1
2 changed files with 4 additions and 4 deletions
|
@ -56,11 +56,11 @@ final class PhabricatorRemarkupRuleEmbedFile
|
|||
$attrs['src'] = $file->getBestURI();
|
||||
$options['image_class'] = null;
|
||||
$file_data = $file->getMetadata();
|
||||
$height = $file_data[PhabricatorFile::METADATA_IMAGE_HEIGHT];
|
||||
$height = idx($file_data, PhabricatorFile::METADATA_IMAGE_HEIGHT);
|
||||
if ($height) {
|
||||
$attrs['height'] = $height;
|
||||
}
|
||||
$width = $file_data[PhabricatorFile::METADATA_IMAGE_WIDTH];
|
||||
$width = idx($file_data, PhabricatorFile::METADATA_IMAGE_WIDTH);
|
||||
if ($width) {
|
||||
$attrs['width'] = $width;
|
||||
}
|
||||
|
|
|
@ -34,8 +34,8 @@ final class PhabricatorRemarkupRuleImageMacro
|
|||
if ($file) {
|
||||
$src_uri = $file->getBestURI();
|
||||
$file_data = $file->getMetadata();
|
||||
$height = $file_data[PhabricatorFile::METADATA_IMAGE_HEIGHT];
|
||||
$width = $file_data[PhabricatorFile::METADATA_IMAGE_WIDTH];
|
||||
$height = idx($file_data,PhabricatorFile::METADATA_IMAGE_HEIGHT);
|
||||
$width = idx($file_data, PhabricatorFile::METADATA_IMAGE_WIDTH);
|
||||
if ($height && $width) {
|
||||
$style = sprintf(
|
||||
'height: %dpx; width: %dpx;',
|
||||
|
|
Loading…
Reference in a new issue