@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.

Replace manual query string construction with "phutil_build_http_querystring()"

Summary: Now that we have a nice function for this, use it to simplify some code.

Test Plan: Ran through the Duo enroll workflow to make sure signing still works.

Reviewers: amckinley

Reviewed By: amckinley

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

+9 -12
+6 -2
src/aphront/configuration/AphrontApplicationConfiguration.php
··· 772 772 $multipart_parser->continueParse($raw_input); 773 773 $parts = $multipart_parser->endParse(); 774 774 775 + // We're building and then parsing a query string so that requests 776 + // with arrays (like "x[]=apple&x[]=banana") work correctly. This also 777 + // means we can't use "phutil_build_http_querystring()", since it 778 + // can't build a query string with duplicate names. 779 + 775 780 $query_string = array(); 776 781 foreach ($parts as $part) { 777 782 if (!$part->isVariable()) { ··· 780 785 781 786 $name = $part->getName(); 782 787 $value = $part->getVariableValue(); 783 - 784 - $query_string[] = urlencode($name).'='.urlencode($value); 788 + $query_string[] = rawurlencode($name).'='.rawurlencode($value); 785 789 } 786 790 $query_string = implode('&', $query_string); 787 791 $post = $parser->parseQueryString($query_string);
+1 -4
src/applications/auth/factor/PhabricatorDuoAuthFactor.php
··· 504 504 $push_info = array( 505 505 pht('Domain') => $this->getInstallDisplayName(), 506 506 ); 507 - foreach ($push_info as $k => $v) { 508 - $push_info[$k] = rawurlencode($k).'='.rawurlencode($v); 509 - } 510 - $push_info = implode('&', $push_info); 507 + $push_info = phutil_build_http_querystring($push_info); 511 508 512 509 $parameters = array( 513 510 'username' => $duo_user,
+1 -5
src/applications/auth/future/PhabricatorDuoFuture.php
··· 91 91 $http_method = $this->getHTTPMethod(); 92 92 93 93 ksort($data); 94 - $data_parts = array(); 95 - foreach ($data as $key => $value) { 96 - $data_parts[] = rawurlencode($key).'='.rawurlencode($value); 97 - } 98 - $data_parts = implode('&', $data_parts); 94 + $data_parts = phutil_build_http_querystring($data); 99 95 100 96 $corpus = array( 101 97 $date,
+1 -1
src/applications/diffusion/controller/DiffusionServeController.php
··· 528 528 unset($query_data[$key]); 529 529 } 530 530 } 531 - $query_string = http_build_query($query_data, '', '&'); 531 + $query_string = phutil_build_http_querystring($query_data); 532 532 533 533 // We're about to wipe out PATH with the rest of the environment, so 534 534 // resolve the binary first.