Page MenuHomePhabricator

D9597.id22989.diff
No OneTemporary

D9597.id22989.diff

diff --git a/src/utils/utf8.php b/src/utils/utf8.php
--- a/src/utils/utf8.php
+++ b/src/utils/utf8.php
@@ -190,6 +190,9 @@
*/
function phutil_utf8_console_strlen($string) {
+ // Formatting and colors don't contribute any width in the console.
+ $string = preg_replace('/\e\[\d*m/sU', '', $string);
+
// In the common case of an ASCII string, just return the string length.
if (preg_match('/^[\x01-\x7F]*\z/', $string)) {
return strlen($string);

File Metadata

Mime Type
text/plain
Expires
Fri, Mar 21, 3:54 PM (18 h, 41 m ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7388545
Default Alt Text
D9597.id22989.diff (464 B)

Event Timeline