Skip to content

Commit 6be8d65

Browse files
author
epriestley
committedAug 30, 2014
Convert two missed phutil_utf8_shorten() callsites
Summary: Fixes T6006. These didn't get caught by D10392. Test Plan: Forced migration to re-run; ran SSH commands against Phabricator. Auditors: btrahan
1 parent b93bc7e commit 6be8d65

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed
 

‎resources/sql/patches/20131121.repocredentials.2.mig.php

+6-1
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,14 @@
6767
foreach ($credential_usernames as $username => $credential_secrets) {
6868
foreach ($credential_secrets as $secret_plaintext => $repositories) {
6969
$callsigns = mpull($repositories, 'getCallsign');
70+
71+
$signs = implode(', ', $callsigns);
72+
7073
$name = pht(
7174
'Migrated Repository Credential (%s)',
72-
phutil_utf8_shorten(implode(', ', $callsigns), 128));
75+
id(new PhutilUTF8StringTruncator())
76+
->setMaximumGlyphs(128)
77+
->truncateString($signs));
7378

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

‎scripts/ssh/ssh-exec.php

+6-3
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,15 @@
8282
implode(', ', $workflow_names)));
8383
}
8484

85+
$log_argv = implode(' ', array_slice($original_argv, 1));
86+
$log_argv = id(new PhutilUTF8StringTruncator())
87+
->setMaximumCodepoints(128)
88+
->truncateString($log_argv);
89+
8590
$ssh_log->setData(
8691
array(
8792
'C' => $original_argv[0],
88-
'U' => phutil_utf8_shorten(
89-
implode(' ', array_slice($original_argv, 1)),
90-
128),
93+
'U' => $log_argv,
9194
));
9295

9396
$command = head($original_argv);

0 commit comments

Comments
 (0)
Failed to load comments.