1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-22 05:20:56 +01:00

Provide a more informative alternative to 404 on invalid shortened Phurl URL

Summary: When accessing an invalid URL on the short Phurl domain, users should see informative message

Test Plan: Open URL in the previously configured Phurl short domain such as `https://www.zz.us` and see dialog with message. Open `https://www.zz.us/u/123` for a valid `U123` Phurl and access destination URL.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D14450
This commit is contained in:
lkassianik 2015-11-09 14:33:36 -08:00
parent b315f61f49
commit 2b5bb642c0

View file

@ -8,6 +8,16 @@ final class PhabricatorPhurlShortURLDefaultController
} }
public function handleRequest(AphrontRequest $request) { public function handleRequest(AphrontRequest $request) {
return new Aphront404Response(); $dialog = $this->newDialog()
->setTitle(pht('Invalid URL'))
->appendParagraph(
pht('This domain can only be used to open URLs'.
' shortened using the Phurl application. The'.
' URL you are trying to access does not have'.
' a Phurl URL associated with it.'));
return id(new AphrontDialogResponse())
->setDialog($dialog)
->setHTTPResponseCode(404);
} }
} }