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
Sat, Nov 9, 5:04 AM (4 d, 22 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6762786
Default Alt Text
D9597.id22989.diff (464 B)

Event Timeline