From bdecadfd119e6ebcbbb81e40fa2ce0ee78082982 Mon Sep 17 00:00:00 2001 From: indiefan Date: Wed, 30 Jan 2013 08:11:26 -0800 Subject: [PATCH] Returning simple text error message instead of HTML for requests where HTML won't be rendered for the user. Fixes T2401. Summary: If the check is too much, let me know. I noticed you send over __ajax__=true, so I figured it was safest to evaluate existance and value. Test Plan: Included unit test. Would have included a test where __ajax__ and __conduit__ are not set, but without mocking this gives an uncatchable Fatal Error. If you want me to include it, just direct me on the mocking strategy. Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Maniphest Tasks: T2401 Differential Revision: https://secure.phabricator.com/D4719 --- .../config/response/PhabricatorConfigResponse.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/applications/config/response/PhabricatorConfigResponse.php b/src/applications/config/response/PhabricatorConfigResponse.php index 02fc190816..479df39cd1 100644 --- a/src/applications/config/response/PhabricatorConfigResponse.php +++ b/src/applications/config/response/PhabricatorConfigResponse.php @@ -10,6 +10,15 @@ final class PhabricatorConfigResponse extends AphrontHTMLResponse { } public function buildResponseString() { + // Check to make sure we aren't requesting this via ajax or conduit + if (isset($_REQUEST['__ajax__']) || isset($_REQUEST['__conduit__'])) { + // We don't want to flood the console with html, just return a simple + // message for now. + return pht( + "This install has a fatal setup error, access the internet web ". + "version to view details and resolve it."); + } + $resources = $this->buildResources(); $view = $this->view->render();