1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-26 00:32:42 +01:00

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
This commit is contained in:
Gareth Evans 2013-06-24 07:24:00 -07:00 committed by epriestley
parent 933d45d5cf
commit e40f0e13c5
2 changed files with 8 additions and 1 deletions

View file

@ -83,7 +83,7 @@ class AphrontDefaultApplicationConfiguration
public function buildRequest() { public function buildRequest() {
$request = new AphrontRequest($this->getHost(), $this->getPath()); $request = new AphrontRequest($this->getHost(), $this->getPath());
$request->setRequestData($_GET + $_POST); $request->setRequestData($_POST + $_GET);
$request->setApplicationConfiguration($this); $request->setApplicationConfiguration($this);
return $request; return $request;
} }

View file

@ -34,6 +34,13 @@ try {
$host = AphrontRequest::getHTTPHeader('Host'); $host = AphrontRequest::getHTTPHeader('Host');
$path = $_REQUEST['__path__']; $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) { switch ($host) {
default: default:
$config_key = 'aphront.default-application-configuration-class'; $config_key = 'aphront.default-application-configuration-class';