1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-20 01:08:50 +02:00

Let PhabricatorPlatformSite catch unconfigured requests

Summary: Fix T8717. If the install didn't configure base-uri, assume they want Phabricator; We'll later show the setup warning about it.

Test Plan: Set base-uri to something else, see short error. Delete it, see Phabricator.

Reviewers: laomoi, #blessed_reviewers, epriestley

Reviewed By: laomoi, #blessed_reviewers, epriestley

Subscribers: laomoi, epriestley, Korvin

Maniphest Tasks: T8717

Differential Revision: https://secure.phabricator.com/D13482
This commit is contained in:
epriestley 2015-06-30 05:18:51 -07:00
parent 12c6e63d5b
commit 9eda21451a

View file

@ -11,8 +11,15 @@ final class PhabricatorPlatformSite extends PhabricatorSite {
}
public function newSiteForRequest(AphrontRequest $request) {
// If no base URI has been configured yet, match this site so the user
// can follow setup instructions.
$base_uri = PhabricatorEnv::getEnvConfig('phabricator.base-uri');
if (!strlen($base_uri)) {
return new PhabricatorPlatformSite();
}
$uris = array();
$uris[] = PhabricatorEnv::getEnvConfig('phabricator.base-uri');
$uris[] = $base_uri;
$uris[] = PhabricatorEnv::getEnvConfig('phabricator.production-uri');
$allowed = PhabricatorEnv::getEnvConfig('phabricator.allowed-uris');