mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-27 01:02:42 +01:00
Convert some phutil_escape_html() to hsprintf()
Summary: In the second phase, I want to get rid of the most of `phutil_escape_html()` calls in favor of plain strings or `PhutilSafeHTML`. This is an example of how it could look. Test Plan: /api/user.whoami Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Maniphest Tasks: T2432 Differential Revision: https://secure.phabricator.com/D4823
This commit is contained in:
parent
8f1311bbc1
commit
bcf9b9d4a7
3 changed files with 9 additions and 12 deletions
|
@ -396,12 +396,9 @@ final class PhabricatorConduitAPIController
|
|||
$json = new PhutilJSON();
|
||||
if (is_array($value)) {
|
||||
$value = $json->encodeFormatted($value);
|
||||
$value = phutil_escape_html($value);
|
||||
} else {
|
||||
$value = phutil_escape_html($value);
|
||||
}
|
||||
|
||||
$value = '<pre style="white-space: pre-wrap;">'.$value.'</pre>';
|
||||
$value = hsprintf('<pre style="white-space: pre-wrap;">%s</pre>', $value);
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
|
|
@ -58,11 +58,10 @@ final class PhabricatorConduitConsoleController
|
|||
if ($error_types) {
|
||||
$error_description[] = '<ul>';
|
||||
foreach ($error_types as $error => $meaning) {
|
||||
$error_description[] =
|
||||
'<li>'.
|
||||
'<strong>'.phutil_escape_html($error).':</strong> '.
|
||||
phutil_escape_html($meaning).
|
||||
'</li>';
|
||||
$error_description[] = hsprintf(
|
||||
'<li><strong>%s:</strong> %s</li>',
|
||||
$error,
|
||||
$meaning);
|
||||
}
|
||||
$error_description[] = '</ul>';
|
||||
$error_description = implode("\n", $error_description);
|
||||
|
|
|
@ -32,14 +32,15 @@ final class PhabricatorConduitTokenController
|
|||
$panel->setHeader('Certificate Install Token');
|
||||
$panel->setWidth(AphrontPanelView::WIDTH_FORM);
|
||||
|
||||
$panel->appendChild(
|
||||
$panel->appendChild(hsprintf(
|
||||
'<p class="aphront-form-instructions">Copy and paste this token into '.
|
||||
'the prompt given to you by "arc install-certificate":</p>'.
|
||||
'<p style="padding: 0 0 1em 4em;">'.
|
||||
'<strong>'.phutil_escape_html($token->getToken()).'</strong>'.
|
||||
'<strong>%s</strong>'.
|
||||
'</p>'.
|
||||
'<p class="aphront-form-instructions">arc will then complete the '.
|
||||
'install process for you.</p>');
|
||||
'install process for you.</p>',
|
||||
$token->getToken()));
|
||||
|
||||
$this->setShowSideNav(false);
|
||||
|
||||
|
|
Loading…
Reference in a new issue