mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-29 02:02:41 +01:00
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
This commit is contained in:
parent
1fd69f788c
commit
308c4f2407
1 changed files with 8 additions and 3 deletions
|
@ -591,10 +591,15 @@ final class AphrontRequest extends Phobject {
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getRequestURI() {
|
public function getRequestURI() {
|
||||||
$get = $_GET;
|
$request_uri = idx($_SERVER, 'REQUEST_URI', '/');
|
||||||
unset($get['__path__']);
|
|
||||||
|
$uri = new PhutilURI($request_uri);
|
||||||
|
$uri->setQueryParam('__path__', null);
|
||||||
|
|
||||||
$path = phutil_escape_uri($this->getPath());
|
$path = phutil_escape_uri($this->getPath());
|
||||||
return id(new PhutilURI($path))->setQueryParams($get);
|
$uri->setPath($path);
|
||||||
|
|
||||||
|
return $uri;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getAbsoluteRequestURI() {
|
public function getAbsoluteRequestURI() {
|
||||||
|
|
Loading…
Reference in a new issue