From 9eda21451a4455ba0c11bf675b334c028e29b0c9 Mon Sep 17 00:00:00 2001 From: epriestley Date: Tue, 30 Jun 2015 05:18:51 -0700 Subject: [PATCH] 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 --- src/aphront/site/PhabricatorPlatformSite.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/aphront/site/PhabricatorPlatformSite.php b/src/aphront/site/PhabricatorPlatformSite.php index 21e2cd2529..63c2b9cde3 100644 --- a/src/aphront/site/PhabricatorPlatformSite.php +++ b/src/aphront/site/PhabricatorPlatformSite.php @@ -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');