1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-01-11 07:11:04 +01:00

When the profiler is active, keep it active if the user submits forms

Summary: Ref T12297. When a page is generated with the profiler active, keep it active by adding a `__profile__` input to any forms we generate.

Test Plan: Hit Conduit API page with `__profile__` active, saw it reflected in forms.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T12297

Differential Revision: https://secure.phabricator.com/D17399
This commit is contained in:
epriestley 2017-02-23 09:30:15 -08:00
parent 84aff44bcd
commit ad032e72ca

View file

@ -98,6 +98,19 @@ function phabricator_form(PhabricatorUser $user, $attributes, $content) {
'name' => '__form__',
'value' => true,
));
// If the profiler was active for this request, keep it active for any
// forms submitted from this page.
if (DarkConsoleXHProfPluginAPI::isProfilerRequested()) {
$body[] = phutil_tag(
'input',
array(
'type' => 'hidden',
'name' => '__profile__',
'value' => true,
));
}
}
}