Skip to content

Commit 58ba8e7

Browse files
author
epriestley
committed
Use correct viewer for debug.stop-on-redirect
Summary: See <phacility#563>. I think this secondary construction of a `$user` is very old, and predates subsequent changes which cause a proper user to construct earlier, so using the user on the `$request` should (I think) always work. I couldn't immediately find any cases where it does not. Test Plan: With `debug.stop-on-redirect` set, hit various redirects, like jump-naving to T1. Got a proper stop dialog. Reviewers: btrahan Reviewed By: btrahan Subscribers: epriestley Differential Revision: https://secure.phabricator.com/D8718
1 parent b937bf5 commit 58ba8e7

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/aphront/response/AphrontRedirectResponse.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,17 @@ public function getHeaders() {
4141

4242
public function buildResponseString() {
4343
if ($this->shouldStopForDebugging()) {
44-
$user = new PhabricatorUser();
44+
$request = $this->getRequest();
45+
$viewer = $request->getUser();
4546

4647
$view = new PhabricatorStandardPageView();
4748
$view->setRequest($this->getRequest());
48-
$view->setApplicationName('Debug');
49-
$view->setTitle('Stopped on Redirect');
49+
$view->setApplicationName(pht('Debug'));
50+
$view->setTitle(pht('Stopped on Redirect'));
5051

5152
$dialog = new AphrontDialogView();
52-
$dialog->setUser($user);
53-
$dialog->setTitle('Stopped on Redirect');
53+
$dialog->setUser($viewer);
54+
$dialog->setTitle(pht('Stopped on Redirect'));
5455

5556
$dialog->appendParagraph(
5657
pht(
@@ -68,7 +69,7 @@ public function buildResponseString() {
6869

6970
$dialog->appendChild(
7071
id(new AphrontStackTraceView())
71-
->setUser($user)
72+
->setUser($viewer)
7273
->setTrace($this->stackWhenCreated));
7374

7475
$dialog->setIsStandalone(true);

0 commit comments

Comments
 (0)