Changeset View
Changeset View
Standalone View
Standalone View
src/aphront/configuration/AphrontApplicationConfiguration.php
Show First 20 Lines • Show All 817 Lines • ▼ Show 20 Lines | private static function readHTTPPOSTData() { | ||||
// If the content type is "multipart/form-data", we need to build both | // If the content type is "multipart/form-data", we need to build both | ||||
// $_POST and $_FILES, which is involved. The body itself is also more | // $_POST and $_FILES, which is involved. The body itself is also more | ||||
// difficult to parse than other requests. | // difficult to parse than other requests. | ||||
$raw_input = PhabricatorStartup::getRawInput(); | $raw_input = PhabricatorStartup::getRawInput(); | ||||
$parser = new PhutilQueryStringParser(); | $parser = new PhutilQueryStringParser(); | ||||
if (strlen($raw_input)) { | if (phutil_nonempty_string($raw_input)) { | ||||
$content_type = idx($_SERVER, 'CONTENT_TYPE'); | $content_type = idx($_SERVER, 'CONTENT_TYPE'); | ||||
$is_multipart = preg_match('@^multipart/form-data@i', $content_type); | $is_multipart = preg_match('@^multipart/form-data@i', $content_type); | ||||
if ($is_multipart) { | if ($is_multipart) { | ||||
$multipart_parser = id(new AphrontMultipartParser()) | $multipart_parser = id(new AphrontMultipartParser()) | ||||
->setContentType($content_type); | ->setContentType($content_type); | ||||
$multipart_parser->beginParse(); | $multipart_parser->beginParse(); | ||||
$multipart_parser->continueParse($raw_input); | $multipart_parser->continueParse($raw_input); | ||||
▲ Show 20 Lines • Show All 45 Lines • Show Last 20 Lines |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0