Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2862955
D25357.1736454446.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
2 KB
Referenced Files
None
Subscribers
None
D25357.1736454446.diff
View Options
diff --git a/src/view/phui/PHUIObjectItemView.php b/src/view/phui/PHUIObjectItemView.php
--- a/src/view/phui/PHUIObjectItemView.php
+++ b/src/view/phui/PHUIObjectItemView.php
@@ -90,11 +90,7 @@
* @return self
*/
public function setHref($href) {
-
- // We have not a very clear idea about what this method should receive
- // So, let's log alien stuff for some time
- // https://we.phorge.it/T15316
- self::requireValidHref($href, 'href');
+ PhutilURI::checkHrefType($href);
$this->href = $href;
return $this;
@@ -161,11 +157,7 @@
* @return self
*/
public function setImageHref($image_href) {
-
- // We have not a very clear idea about what this method should receive
- // So, let's log alien stuff for some time
- // https://we.phorge.it/T15316
- self::requireValidHref($image_href, 'image_href');
+ PhutilURI::checkHrefType($image_href);
$this->imageHref = $image_href;
return $this;
@@ -929,30 +921,4 @@
return javelin_tag('span', $options, '');
}
-
- /**
- * Receive a href attribute and check if it has expected values
- *
- * TODO: Feel free to remove after 2023, if no more new reports arrive.
- *
- * https://we.phorge.it/T15316
- *
- * @param mixed $href Value to be checked
- * @param string $variable_name Human reference
- */
- private static function requireValidHref($href, $variable_name) {
-
- // We have not a very clear idea about what a "href" should be
- if (is_object($href) && !($href instanceof PhutilURI)) {
-
- // We log stuff with a kind stack trace
- phlog(new Exception(pht(
- 'The variable %s received an unexpected type: %s. '.
- 'Please share this stack trace as comment in Task %s',
- $variable_name,
- get_class($href),
- 'https://we.phorge.it/T15316')));
- }
- }
-
}
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
@@ -103,20 +103,11 @@
/**
* Set the href attribute
*
- * @param string|null $href
+ * @param string|PhutilURI|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!
- // https://we.phorge.it/T15316
- if (is_object($href)) {
- phlog(sprintf(
- 'Received unexpected type for href: %s. '.
- 'Please paste this log as comment in https://we.phorge.it/T15316',
- get_class($href)));
- }
+ PhutilURI::checkHrefType($href);
$this->href = $href;
return $this;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Jan 9, 20:27 (1 d, 10 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1108744
Default Alt Text
D25357.1736454446.diff (2 KB)
Attached To
Mode
D25357: Unify type-checking for `setHref()` type methods
Attached
Detach File
Event Timeline
Log In to Comment