Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13957659
D16473.id39638.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
D16473.id39638.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
@@ -86,7 +86,7 @@
->setTag('a')
->setText(pht('Visit URL'))
->setIcon('fa-external-link')
- ->setHref("u/{$id}")
+ ->setHref($url->getRedirectURI())
->setDisabled(!$url->isValid());
$header = id(new PHUIHeaderView())
@@ -130,6 +130,10 @@
->setUser($viewer);
$properties->addProperty(
+ pht('Short URL'),
+ $url->getRedirectURI());
+
+ $properties->addProperty(
pht('Original URL'),
$url->getLongURL());
diff --git a/src/applications/phurl/storage/PhabricatorPhurlURL.php b/src/applications/phurl/storage/PhabricatorPhurlURL.php
--- a/src/applications/phurl/storage/PhabricatorPhurlURL.php
+++ b/src/applications/phurl/storage/PhabricatorPhurlURL.php
@@ -99,10 +99,18 @@
public function getRedirectURI() {
if (strlen($this->getAlias())) {
- return '/u/'.$this->getAlias();
+ $path = '/u/'.$this->getAlias();
} else {
- return '/u/'.$this->getID();
+ $path = '/u/'.$this->getID();
}
+ $short_domain = PhabricatorEnv::getEnvConfig('phurl.short-uri');
+ if (!$short_domain) {
+ return $path;
+ }
+
+ $uri = new PhutilURI($short_domain);
+ $uri->setPath($path);
+ return (string)$uri;
}
/* -( PhabricatorPolicyInterface )----------------------------------------- */
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Oct 15 2024, 10:31 AM (4 w, 6 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6712533
Default Alt Text
D16473.id39638.diff (1 KB)
Attached To
Mode
D16473: Start actually showing the phurl urls to users
Attached
Detach File
Event Timeline
Log In to Comment