@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

vrana bcf9b9d4 8f1311bb

+9 -12
+1 -4
src/applications/conduit/controller/PhabricatorConduitAPIController.php
··· 396 396 $json = new PhutilJSON(); 397 397 if (is_array($value)) { 398 398 $value = $json->encodeFormatted($value); 399 - $value = phutil_escape_html($value); 400 - } else { 401 - $value = phutil_escape_html($value); 402 399 } 403 400 404 - $value = '<pre style="white-space: pre-wrap;">'.$value.'</pre>'; 401 + $value = hsprintf('<pre style="white-space: pre-wrap;">%s</pre>', $value); 405 402 406 403 return $value; 407 404 }
+4 -5
src/applications/conduit/controller/PhabricatorConduitConsoleController.php
··· 58 58 if ($error_types) { 59 59 $error_description[] = '<ul>'; 60 60 foreach ($error_types as $error => $meaning) { 61 - $error_description[] = 62 - '<li>'. 63 - '<strong>'.phutil_escape_html($error).':</strong> '. 64 - phutil_escape_html($meaning). 65 - '</li>'; 61 + $error_description[] = hsprintf( 62 + '<li><strong>%s:</strong> %s</li>', 63 + $error, 64 + $meaning); 66 65 } 67 66 $error_description[] = '</ul>'; 68 67 $error_description = implode("\n", $error_description);
+4 -3
src/applications/conduit/controller/PhabricatorConduitTokenController.php
··· 32 32 $panel->setHeader('Certificate Install Token'); 33 33 $panel->setWidth(AphrontPanelView::WIDTH_FORM); 34 34 35 - $panel->appendChild( 35 + $panel->appendChild(hsprintf( 36 36 '<p class="aphront-form-instructions">Copy and paste this token into '. 37 37 'the prompt given to you by "arc install-certificate":</p>'. 38 38 '<p style="padding: 0 0 1em 4em;">'. 39 - '<strong>'.phutil_escape_html($token->getToken()).'</strong>'. 39 + '<strong>%s</strong>'. 40 40 '</p>'. 41 41 '<p class="aphront-form-instructions">arc will then complete the '. 42 - 'install process for you.</p>'); 42 + 'install process for you.</p>', 43 + $token->getToken())); 43 44 44 45 $this->setShowSideNav(false); 45 46