From e40f0e13c5dc4da7656ef6ced008eec262490e3d Mon Sep 17 00:00:00 2001 From: Gareth Evans Date: Mon, 24 Jun 2013 07:24:00 -0700 Subject: [PATCH] Implement PhutilRequest parser Summary: If D6277 is the way to go, then this will be it's implementation. Depends on D6277 Test Plan: Keep using the site Reviewers: epriestley CC: aran, Korvin Maniphest Tasks: T3432 Differential Revision: https://secure.phabricator.com/D6278 --- .../AphrontDefaultApplicationConfiguration.php | 2 +- webroot/index.php | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/aphront/configuration/AphrontDefaultApplicationConfiguration.php b/src/aphront/configuration/AphrontDefaultApplicationConfiguration.php index fbf5b645cb..0fc133d8b6 100644 --- a/src/aphront/configuration/AphrontDefaultApplicationConfiguration.php +++ b/src/aphront/configuration/AphrontDefaultApplicationConfiguration.php @@ -83,7 +83,7 @@ class AphrontDefaultApplicationConfiguration public function buildRequest() { $request = new AphrontRequest($this->getHost(), $this->getPath()); - $request->setRequestData($_GET + $_POST); + $request->setRequestData($_POST + $_GET); $request->setApplicationConfiguration($this); return $request; } diff --git a/webroot/index.php b/webroot/index.php index 7ee22338cc..5db2067175 100644 --- a/webroot/index.php +++ b/webroot/index.php @@ -34,6 +34,13 @@ try { $host = AphrontRequest::getHTTPHeader('Host'); $path = $_REQUEST['__path__']; + $parser = new PhutilQueryStringParser(); + $_GET = $parser->parseQueryString( + isset($_SERVER['QUERY_STRING']) ? $_SERVER['QUERY_STRING'] : ""); + $_POST = $parser->parseQueryString( + (string)file_get_contents('php://input')); + $_REQUEST = $_POST + $_GET; + switch ($host) { default: $config_key = 'aphront.default-application-configuration-class';