Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F18712812
D14379.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D14379.id.diff
View Options
diff --git a/src/applications/phurl/controller/PhabricatorPhurlURLViewController.php b/src/applications/phurl/controller/PhabricatorPhurlURLViewController.php
--- a/src/applications/phurl/controller/PhabricatorPhurlURLViewController.php
+++ b/src/applications/phurl/controller/PhabricatorPhurlURLViewController.php
@@ -96,13 +96,33 @@
$url,
PhabricatorPolicyCapability::CAN_EDIT);
- $actions->addAction(
- id(new PhabricatorActionView())
- ->setName(pht('Edit'))
- ->setIcon('fa-pencil')
- ->setHref($this->getApplicationURI("url/edit/{$id}/"))
- ->setDisabled(!$can_edit)
- ->setWorkflow(!$can_edit));
+ $allowed_protocols = PhabricatorEnv::getEnvConfig('uri.allowed-protocols');
+ $uri = new PhutilURI($url->getLongURL());
+ $url_protocol = $uri->getProtocol();
+
+ $can_access = false;
+ $redirect_uri = $url->getMonogram();
+
+ if (strlen($url_protocol)) {
+ $can_access = in_array($url_protocol, $allowed_protocols);
+ $redirect_uri = $uri;
+ }
+
+ $actions
+ ->addAction(
+ id(new PhabricatorActionView())
+ ->setName(pht('Edit'))
+ ->setIcon('fa-pencil')
+ ->setHref($this->getApplicationURI("url/edit/{$id}/"))
+ ->setDisabled(!$can_edit)
+ ->setWorkflow(!$can_edit))
+ ->addAction(
+ id(new PhabricatorActionView())
+ ->setName(pht('Visit URL'))
+ ->setIcon('fa-external-link')
+ ->setHref($redirect_uri)
+ ->setDisabled(!$can_edit || !$can_access)
+ ->setWorkflow(!$can_edit));
return $actions;
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sep 30 2025, 5:33 AM (15 w, 2 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
8781238
Default Alt Text
D14379.id.diff (1 KB)
Attached To
Mode
D14379: Ref T8989, Add a "Visit URL" link to Phurl items.
Attached
Detach File
Event Timeline
Log In to Comment