Page MenuHomePhabricator

D16473.id39633.diff
No OneTemporary

D16473.id39633.diff

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())
@@ -137,6 +137,10 @@
pht('Alias'),
$url->getAlias());
+ $properties->addProperty(
+ pht('Short URL'),
+ $url->getRedirectURI());
+
$description = $url->getDescription();
if (strlen($description)) {
$description = new PHUIRemarkupView($viewer, $description);
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,12 @@
public function getRedirectURI() {
if (strlen($this->getAlias())) {
- return '/u/'.$this->getAlias();
+ $stub = 'u/'.$this->getAlias();
} else {
- return '/u/'.$this->getID();
+ $stub = 'u/'.$this->getID();
}
+ $short_domain = PhabricatorEnv::getEnvConfig('phurl.short-uri');
+ return $short_domain.$stub;
}
/* -( PhabricatorPolicyInterface )----------------------------------------- */

File Metadata

Mime Type
text/plain
Expires
Tue, Mar 18, 4:10 PM (3 w, 19 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7705811
Default Alt Text
D16473.id39633.diff (1 KB)

Event Timeline