From 1fc4439ca5ff814b36d8750519e9f39eaa0944cd Mon Sep 17 00:00:00 2001 From: epriestley Date: Tue, 19 Apr 2022 14:54:29 -0700 Subject: [PATCH] Fix a PHP 8.1 issue with "phutil_console_strlen()" Summary: Ref T13588. Test Plan: Ran unit tests in D21757. Maniphest Tasks: T13588 Differential Revision: https://secure.phabricator.com/D21758 --- src/utils/utf8.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/utils/utf8.php b/src/utils/utf8.php index c92ee533..06d014fa 100644 --- a/src/utils/utf8.php +++ b/src/utils/utf8.php @@ -314,6 +314,8 @@ function phutil_utf8_strlen($string) { * @return int The console display length of the string. */ function phutil_utf8_console_strlen($string) { + $string = phutil_string_cast($string); + // Formatting and colors don't contribute any width in the console. $string = preg_replace("/\x1B\[\d*m/", '', $string);