Skip to content

Commit

Permalink
Convert two missed phutil_utf8_shorten() callsites
Browse files Browse the repository at this point in the history
Summary: Fixes T6006. These didn't get caught by D10392.

Test Plan: Forced migration to re-run; ran SSH commands against Phabricator.

Auditors: btrahan
  • Loading branch information
epriestley committed Aug 30, 2014
1 parent b93bc7e commit 6be8d65
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
7 changes: 6 additions & 1 deletion resources/sql/patches/20131121.repocredentials.2.mig.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,14 @@
foreach ($credential_usernames as $username => $credential_secrets) {
foreach ($credential_secrets as $secret_plaintext => $repositories) {
$callsigns = mpull($repositories, 'getCallsign');

$signs = implode(', ', $callsigns);

$name = pht(
'Migrated Repository Credential (%s)',
phutil_utf8_shorten(implode(', ', $callsigns), 128));
id(new PhutilUTF8StringTruncator())
->setMaximumGlyphs(128)
->truncateString($signs));

echo "Creating: {$name}...\n";

Expand Down
9 changes: 6 additions & 3 deletions scripts/ssh/ssh-exec.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,15 @@
implode(', ', $workflow_names)));
}

$log_argv = implode(' ', array_slice($original_argv, 1));
$log_argv = id(new PhutilUTF8StringTruncator())
->setMaximumCodepoints(128)
->truncateString($log_argv);

$ssh_log->setData(
array(
'C' => $original_argv[0],
'U' => phutil_utf8_shorten(
implode(' ', array_slice($original_argv, 1)),
128),
'U' => $log_argv,
));

$command = head($original_argv);
Expand Down

0 comments on commit 6be8d65

Please sign in to comment.