diff --git a/src/view/phui/PHUITagView.php b/src/view/phui/PHUITagView.php --- a/src/view/phui/PHUITagView.php +++ b/src/view/phui/PHUITagView.php @@ -100,7 +100,23 @@ return $this; } + /** + * Set the href attribute + * + * @param string|null $href + * @return self + */ public function setHref($href) { + + // We have not a very clear idea about what this method should receive + // We suspect that PhutilURI should be allowed... but let's log everything! + if ($href !== null && !is_string($href)) { + phlog(sprintf( + 'Received unexpected type for href: %s. '. + 'Please paste this log as comment in https://we.phorge.it/D25153', + get_class($href))); + } + $this->href = $href; return $this; } @@ -126,7 +142,7 @@ } protected function getTagName() { - return strlen($this->href) ? 'a' : 'span'; + return phutil_nonempty_string($this->href) ? 'a' : 'span'; } public function setContextObject($context_object) {