mirror of
https://we.phorge.it/source/phorge.git
synced 2025-03-28 04:00:17 +01:00
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
19 lines
483 B
PHP
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);
|
|
}
|
|
}
|