mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-27 15:08:20 +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:
parent
84aff44bcd
commit
ad032e72ca
1 changed files with 13 additions and 0 deletions
|
@ -98,6 +98,19 @@ function phabricator_form(PhabricatorUser $user, $attributes, $content) {
|
||||||
'name' => '__form__',
|
'name' => '__form__',
|
||||||
'value' => true,
|
'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,
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue