@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Implement PhutilRequest parser #2

Summary:
D6278 kind of got closed and commited, this is the actual direction.

Ref T3432

Depends on D6277

Test Plan: Keep using the site

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin, mbishopim3

Maniphest Tasks: T3432

Differential Revision: https://secure.phabricator.com/D6283

authored by

Gareth Evans and committed by
epriestley
b26549b5 d0da409e

+32 -9
+18 -1
src/aphront/configuration/AphrontDefaultApplicationConfiguration.php
··· 81 81 ); 82 82 } 83 83 84 + /** 85 + * @phutil-external-symbol class PhabricatorStartup 86 + */ 84 87 public function buildRequest() { 88 + $parser = new PhutilQueryStringParser(); 89 + $data = array(); 90 + 91 + $raw_input = PhabricatorStartup::getRawInput(); 92 + if (strlen($raw_input)) { 93 + $data += $parser->parseQueryString($raw_input); 94 + } else if ($_POST) { 95 + $data += $_POST; 96 + } 97 + 98 + $data += $parser->parseQueryString( 99 + isset($_SERVER['QUERY_STRING']) ? $_SERVER['QUERY_STRING'] : ""); 100 + 85 101 $request = new AphrontRequest($this->getHost(), $this->getPath()); 86 - $request->setRequestData($_POST + $_GET); 102 + $request->setRequestData($data); 87 103 $request->setApplicationConfiguration($this); 104 + 88 105 return $request; 89 106 } 90 107
+4 -1
src/applications/files/controller/PhabricatorFileDropUploadController.php
··· 3 3 final class PhabricatorFileDropUploadController 4 4 extends PhabricatorFileController { 5 5 6 + /** 7 + * @phutil-external-symbol class PhabricatorStartup 8 + */ 6 9 public function processRequest() { 7 10 $request = $this->getRequest(); 8 11 $user = $request->getUser(); ··· 10 13 // NOTE: Throws if valid CSRF token is not present in the request. 11 14 $request->validateCSRF(); 12 15 13 - $data = file_get_contents('php://input'); 16 + $data = PhabricatorStartup::getRawInput(); 14 17 $name = $request->getStr('name'); 15 18 16 19 $file = PhabricatorFile::newFromXHRUpload(
+10
support/PhabricatorStartup.php
··· 18 18 private static $startTime; 19 19 private static $globals = array(); 20 20 private static $capturingOutput; 21 + private static $rawInput; 21 22 22 23 23 24 /* -( Accessing Request Information )-------------------------------------- */ ··· 61 62 return self::$globals[$key]; 62 63 } 63 64 65 + /** 66 + * @task info 67 + */ 68 + public static function getRawInput() { 69 + return self::$rawInput; 70 + } 71 + 64 72 65 73 /* -( Startup Hooks )------------------------------------------------------ */ 66 74 ··· 89 97 self::detectPostMaxSizeTriggered(); 90 98 91 99 self::beginOutputCapture(); 100 + 101 + self::$rawInput = (string)file_get_contents('php://input'); 92 102 } 93 103 94 104
-7
webroot/index.php
··· 34 34 $host = AphrontRequest::getHTTPHeader('Host'); 35 35 $path = $_REQUEST['__path__']; 36 36 37 - $parser = new PhutilQueryStringParser(); 38 - $_GET = $parser->parseQueryString( 39 - isset($_SERVER['QUERY_STRING']) ? $_SERVER['QUERY_STRING'] : ""); 40 - $_POST = $parser->parseQueryString( 41 - (string)file_get_contents('php://input')); 42 - $_REQUEST = $_POST + $_GET; 43 - 44 37 switch ($host) { 45 38 default: 46 39 $config_key = 'aphront.default-application-configuration-class';