Page MenuHomePhabricator

Start actually showing the phurl urls to users
ClosedPublic

Authored by jcox on Aug 30 2016, 4:41 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Apr 24, 10:32 PM
Unknown Object (File)
Thu, Apr 18, 3:33 PM
Unknown Object (File)
Thu, Apr 11, 7:35 AM
Unknown Object (File)
Thu, Apr 11, 1:56 AM
Unknown Object (File)
Sat, Apr 6, 9:56 PM
Unknown Object (File)
Sat, Mar 30, 12:55 AM
Unknown Object (File)
Fri, Mar 29, 8:38 PM
Unknown Object (File)
Fri, Mar 29, 8:19 PM

Details

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

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

jcox retitled this revision from to Start actually showing the phurl urls to users.
jcox updated this object.
jcox edited the test plan for this revision. (Show Details)
epriestley added a reviewer: epriestley.

One meaningful inline about robustness in the face of trailing slashes.

src/applications/phurl/controller/PhabricatorPhurlURLViewController.php
144–146

Maybe put this first (above "Original URL")? Seems like the most likely field that users are interested in, probably.

src/applications/phurl/storage/PhabricatorPhurlURL.php
106–107

We should probably use PhutilURI() here and do setPath() to be robust against users specifying http://example.whatever (with no trailing slash) as their phurl.short-uri -- something like this?

if (!$short_domain) {
  return $path;
}

$uri = new PhutilURI($short_domain);
$uri->setPath($path);
return (string)$uri;

Then that should work properly whether users set http://x.com (no slash) or http://x.com/ (with slash).

This revision now requires changes to proceed.Aug 30 2016, 4:47 PM
jcox edited edge metadata.

Make short URL construction more robust with regard to trailing slashes in base URLs

uh oh I crossed streams with my diffs. One sec.

Phurl changes look good once the Paste stuff finds its way home.

jcox edited edge metadata.

PASTE CHANGES, RETURN FROM WHENCE YOU CAME!

epriestley edited edge metadata.
This revision is now accepted and ready to land.Aug 30 2016, 6:50 PM
This revision was automatically updated to reflect the committed changes.