mirror of
https://we.phorge.it/source/phorge.git
synced 2025-02-02 18:08:26 +01:00
Replace "getRequestURI()->setQueryParams(array())" with "getPath()"
Summary: Ref T13250. A handful of callsites are doing `getRequestURI()` + `setQueryParams(array())` to get a bare request path. They can just use `getPath()` instead. Test Plan: See inlines. Reviewers: amckinley Reviewed By: amckinley Maniphest Tasks: T13250 Differential Revision: https://secure.phabricator.com/D20150
This commit is contained in:
parent
00ffb190cc
commit
fcd85b6d7b
5 changed files with 9 additions and 15 deletions
|
@ -32,22 +32,21 @@ final class AphrontAjaxResponse extends AphrontResponse {
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildResponseString() {
|
public function buildResponseString() {
|
||||||
|
$request = $this->getRequest();
|
||||||
$console = $this->getConsole();
|
$console = $this->getConsole();
|
||||||
if ($console) {
|
if ($console) {
|
||||||
// NOTE: We're stripping query parameters here both for readability and
|
// NOTE: We're stripping query parameters here both for readability and
|
||||||
// to mitigate BREACH and similar attacks. The parameters are available
|
// to mitigate BREACH and similar attacks. The parameters are available
|
||||||
// in the "Request" tab, so this should not impact usability. See T3684.
|
// in the "Request" tab, so this should not impact usability. See T3684.
|
||||||
$uri = $this->getRequest()->getRequestURI();
|
$path = $request->getPath();
|
||||||
$uri = new PhutilURI($uri);
|
|
||||||
$uri->setQueryParams(array());
|
|
||||||
|
|
||||||
Javelin::initBehavior(
|
Javelin::initBehavior(
|
||||||
'dark-console',
|
'dark-console',
|
||||||
array(
|
array(
|
||||||
'uri' => (string)$uri,
|
'uri' => $path,
|
||||||
'key' => $console->getKey($this->getRequest()),
|
'key' => $console->getKey($request),
|
||||||
'color' => $console->getColor(),
|
'color' => $console->getColor(),
|
||||||
'quicksand' => $this->getRequest()->isQuicksand(),
|
'quicksand' => $request->isQuicksand(),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -60,7 +59,6 @@ final class AphrontAjaxResponse extends AphrontResponse {
|
||||||
|
|
||||||
$response = CelerityAPI::getStaticResourceResponse();
|
$response = CelerityAPI::getStaticResourceResponse();
|
||||||
|
|
||||||
$request = $this->getRequest();
|
|
||||||
if ($request) {
|
if ($request) {
|
||||||
$viewer = $request->getViewer();
|
$viewer = $request->getViewer();
|
||||||
if ($viewer) {
|
if ($viewer) {
|
||||||
|
|
|
@ -11,8 +11,7 @@ final class PhabricatorChatLogChannelLogController
|
||||||
$viewer = $request->getViewer();
|
$viewer = $request->getViewer();
|
||||||
$id = $request->getURIData('channelID');
|
$id = $request->getURIData('channelID');
|
||||||
|
|
||||||
$uri = clone $request->getRequestURI();
|
$uri = new PhutilURI($request->getPath());
|
||||||
$uri->setQueryParams(array());
|
|
||||||
|
|
||||||
$pager = new AphrontCursorPagerView();
|
$pager = new AphrontCursorPagerView();
|
||||||
$pager->setURI($uri);
|
$pager->setURI($uri);
|
||||||
|
|
|
@ -54,8 +54,7 @@ final class PhabricatorMetaMTAApplicationEmailPanel
|
||||||
return new Aphront404Response();
|
return new Aphront404Response();
|
||||||
}
|
}
|
||||||
|
|
||||||
$uri = $request->getRequestURI();
|
$uri = new PhutilURI($request->getPath());
|
||||||
$uri->setQueryParams(array());
|
|
||||||
|
|
||||||
$new = $request->getStr('new');
|
$new = $request->getStr('new');
|
||||||
$edit = $request->getInt('edit');
|
$edit = $request->getInt('edit');
|
||||||
|
|
|
@ -31,8 +31,7 @@ final class PhabricatorEmailAddressesSettingsPanel
|
||||||
$user = $this->getUser();
|
$user = $this->getUser();
|
||||||
$editable = PhabricatorEnv::getEnvConfig('account.editable');
|
$editable = PhabricatorEnv::getEnvConfig('account.editable');
|
||||||
|
|
||||||
$uri = $request->getRequestURI();
|
$uri = new PhutilURI($request->getPath());
|
||||||
$uri->setQueryParams(array());
|
|
||||||
|
|
||||||
if ($editable) {
|
if ($editable) {
|
||||||
$new = $request->getStr('new');
|
$new = $request->getStr('new');
|
||||||
|
|
|
@ -1279,8 +1279,7 @@ abstract class PhabricatorEditEngine
|
||||||
|
|
||||||
$fields = $this->willBuildEditForm($object, $fields);
|
$fields = $this->willBuildEditForm($object, $fields);
|
||||||
|
|
||||||
$request_path = $request->getRequestURI()
|
$request_path = $request->getPath();
|
||||||
->setQueryParams(array());
|
|
||||||
|
|
||||||
$form = id(new AphrontFormView())
|
$form = id(new AphrontFormView())
|
||||||
->setUser($viewer)
|
->setUser($viewer)
|
||||||
|
|
Loading…
Add table
Reference in a new issue