Changeset View
Changeset View
Standalone View
Standalone View
src/applications/files/storage/PhabricatorFile.php
Show First 20 Lines • Show All 1,272 Lines • ▼ Show 20 Lines | if (!$this->isViewableImage()) { | ||||
return null; | return null; | ||||
} | } | ||||
return idx($this->metadata, self::METADATA_IMAGE_WIDTH); | return idx($this->metadata, self::METADATA_IMAGE_WIDTH); | ||||
} | } | ||||
public function getAltText() { | public function getAltText() { | ||||
$alt = $this->getCustomAltText(); | $alt = $this->getCustomAltText(); | ||||
if (strlen($alt)) { | if (phutil_nonempty_string($alt)) { | ||||
valerio.bozzolan: ✅ I verified the above line
The `$alt` variable is the alternative image text that assumes… | |||||
return $alt; | return $alt; | ||||
} | } | ||||
return $this->getDefaultAltText(); | return $this->getDefaultAltText(); | ||||
} | } | ||||
public function getCustomAltText() { | public function getCustomAltText() { | ||||
return idx($this->metadata, self::METADATA_ALT_TEXT); | return idx($this->metadata, self::METADATA_ALT_TEXT); | ||||
▲ Show 20 Lines • Show All 475 Lines • Show Last 20 Lines |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0
✅ I verified the above line
The $alt variable is the alternative image text that assumes null as default, or a string.
The function phutil_nonempty_string() will report alien types, and this is good.