Changeset View
Changeset View
Standalone View
Standalone View
src/view/phui/PHUIObjectItemView.php
Show First 20 Lines • Show All 653 Lines • ▼ Show 20 Lines | if ($this->getImageURI()) { | ||||
$image = phutil_tag( | $image = phutil_tag( | ||||
'div', | 'div', | ||||
array( | array( | ||||
'class' => 'phui-oi-image-icon', | 'class' => 'phui-oi-image-icon', | ||||
), | ), | ||||
$this->getImageIcon()); | $this->getImageIcon()); | ||||
} | } | ||||
if ($image && (strlen($this->href) || strlen($this->imageHref))) { | if ($image && (phutil_nonempty_string($this->href) || | ||||
phutil_nonempty_string($this->imageHref))) { | |||||
$image_href = ($this->imageHref) ? $this->imageHref : $this->href; | $image_href = ($this->imageHref) ? $this->imageHref : $this->href; | ||||
valerio.bozzolan: ✅ OK since the expected input domain is **NULL** (default) or a **string**. The phutil will… | |||||
Not Done Inline ActionsIMPORTANT: This can also be a PhutilURI object. So they should be phutil_nonempty_stringlike().
Steps to reproduce: Create Dashboard, add Panel: Call to phutil_nonempty_string() expected null or a string, got: PhutilURI.. valerio.bozzolan: IMPORTANT: This can also be a `PhutilURI` object. So they should be `phutil_nonempty_stringlike… | |||||
$image = phutil_tag( | $image = phutil_tag( | ||||
'a', | 'a', | ||||
array( | array( | ||||
'href' => $image_href, | 'href' => $image_href, | ||||
), | ), | ||||
$image); | $image); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 230 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
✅ OK since the expected input domain is NULL (default) or a string. The phutil will throw for alien types, and it's OK.