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

Fix "AphrontRequest->getRequestURI()" for requests with "x[]=1" parameters in the URI

Summary:
Ref T13250. See PHI1069. This is a small fix for `getRequestURI()` currently not working if the request includes "x[]=..." PHP-flavored array parameters, beacause they're parsed into arrays by `$_GET` and `setQueryParams(...)` no longer accepts nonscalars.

Instead, just parse the raw request URI.

Test Plan: Visited `/search/hovercard/?phids[]=X`, no more fatal. Dumped the resulting URI, saw it had the right value. Tried `?phids[]=x&x=1&x=1&x=1`, saw the parameters correctly preserved.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13250

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

+8 -3
+8 -3
src/aphront/AphrontRequest.php
··· 591 591 } 592 592 593 593 public function getRequestURI() { 594 - $get = $_GET; 595 - unset($get['__path__']); 594 + $request_uri = idx($_SERVER, 'REQUEST_URI', '/'); 595 + 596 + $uri = new PhutilURI($request_uri); 597 + $uri->setQueryParam('__path__', null); 598 + 596 599 $path = phutil_escape_uri($this->getPath()); 597 - return id(new PhutilURI($path))->setQueryParams($get); 600 + $uri->setPath($path); 601 + 602 + return $uri; 598 603 } 599 604 600 605 public function getAbsoluteRequestURI() {