@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Start actually showing the phurl urls to users

Summary: Fixes T10679. Added a 'short url' field to the phurl link page and changed the "view url" button to link to the shortened version

Test Plan: Create a phurl link (or navigate to an existing one) and note that there is now a field for "Short URL". Also verified that the "Visit URL" button in the top right still works as intended

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley, yelirekim

Maniphest Tasks: T10679

Differential Revision: https://secure.phabricator.com/D16473

Josh Cox 7ce58539 f5537fdf

+15 -3
+5 -1
src/applications/phurl/controller/PhabricatorPhurlURLViewController.php
··· 86 86 ->setTag('a') 87 87 ->setText(pht('Visit URL')) 88 88 ->setIcon('fa-external-link') 89 - ->setHref("u/{$id}") 89 + ->setHref($url->getRedirectURI()) 90 90 ->setDisabled(!$url->isValid()); 91 91 92 92 $header = id(new PHUIHeaderView()) ··· 128 128 129 129 $properties = id(new PHUIPropertyListView()) 130 130 ->setUser($viewer); 131 + 132 + $properties->addProperty( 133 + pht('Short URL'), 134 + $url->getRedirectURI()); 131 135 132 136 $properties->addProperty( 133 137 pht('Original URL'),
+10 -2
src/applications/phurl/storage/PhabricatorPhurlURL.php
··· 99 99 100 100 public function getRedirectURI() { 101 101 if (strlen($this->getAlias())) { 102 - return '/u/'.$this->getAlias(); 102 + $path = '/u/'.$this->getAlias(); 103 103 } else { 104 - return '/u/'.$this->getID(); 104 + $path = '/u/'.$this->getID(); 105 105 } 106 + $short_domain = PhabricatorEnv::getEnvConfig('phurl.short-uri'); 107 + if (!$short_domain) { 108 + return $path; 109 + } 110 + 111 + $uri = new PhutilURI($short_domain); 112 + $uri->setPath($path); 113 + return (string)$uri; 106 114 } 107 115 108 116 /* -( PhabricatorPolicyInterface )----------------------------------------- */