1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-03-28 04:00:17 +01:00
phorge-phorge/src/applications/phurl/controller/PhabricatorPhurlShortURLController.php
lkassianik d8111f828f Allow a domain other than the install domain to serve as a short Phurl domain
Summary: Ref T8995, config option for Phurl short domain to share shortened URL's

Test Plan:
- Configure Phurl short domain to something like "zz.us"
- Navigate to `zz.us`; get 404
- Navigate to `zz.us/u/3` or `zz.us/u/alias` where `U3` is an existing Phurl; redirect to correct destination

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin

Maniphest Tasks: T8995

Differential Revision: https://secure.phabricator.com/D14447
2015-11-09 11:34:20 -08:00

19 lines
483 B
PHP

<?php
final class PhabricatorPhurlShortURLController
extends PhabricatorPhurlController {
public function shouldRequireLogin() {
return false;
}
public function handleRequest(AphrontRequest $request) {
$viewer = $this->getViewer();
$append = $request->getURIData('append');
$main_domain_uri = PhabricatorEnv::getProductionURI('/u/'.$append);
return id(new AphrontRedirectResponse())
->setIsExternal(true)
->setURI($main_domain_uri);
}
}