Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15370013
D10391.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D10391.diff
View Options
diff --git a/src/unit/engine/ArcanistXUnitTestResultParser.php b/src/unit/engine/ArcanistXUnitTestResultParser.php
--- a/src/unit/engine/ArcanistXUnitTestResultParser.php
+++ b/src/unit/engine/ArcanistXUnitTestResultParser.php
@@ -24,7 +24,9 @@
$load_success = @$xunit_dom->loadXML($test_results);
if (!$load_success) {
- $input_start = phutil_utf8_shorten($test_results, 150);
+ $input_start = id(new PhutilUTF8StringTruncator())
+ ->setMaximumGlyphs(150)
+ ->truncateString($test_results);
throw new Exception(
"Failed to load XUnit report; Input starts with:\n\n {$input_start}");
}
diff --git a/src/workflow/ArcanistDiffWorkflow.php b/src/workflow/ArcanistDiffWorkflow.php
--- a/src/workflow/ArcanistDiffWorkflow.php
+++ b/src/workflow/ArcanistDiffWorkflow.php
@@ -1509,7 +1509,9 @@
$preview = explode("\n", $saved);
$preview = array_shift($preview);
$preview = trim($preview);
- $preview = phutil_utf8_shorten($preview, 64);
+ $preview = id(new PhutilUTF8StringTruncator())
+ ->setMaximumGlyphs(64)
+ ->truncateString($preview);
if ($preview) {
$preview = "Message begins:\n\n {$preview}\n\n";
diff --git a/src/workflow/ArcanistFlagWorkflow.php b/src/workflow/ArcanistFlagWorkflow.php
--- a/src/workflow/ArcanistFlagWorkflow.php
+++ b/src/workflow/ArcanistFlagWorkflow.php
@@ -88,7 +88,12 @@
// Make sure notes that are long or have line breaks in them or
// whatever don't mess up the formatting.
$note = implode(' ', preg_split('/\s+/', $note));
- $note = ' ('.phutil_utf8_shorten($note, 40, '...').')';
+ $note = ' ('.
+ id(new PhutilUTF8StringTruncator())
+ ->setMaximumGlyphs(40)
+ ->setTerminator('...')
+ ->truncateString($note).
+ ')';
}
echo phutil_console_format(
"<fg:{$color}>%s</fg> flag%s $verb!\n",
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Mar 13, 9:00 AM (1 w, 2 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7224054
Default Alt Text
D10391.diff (1 KB)
Attached To
Mode
D10391: phutil_utf8_shorten => PhutilUTF8StringTruncator
Attached
Detach File
Event Timeline
Log In to Comment