Skip to content
This repository was archived by the owner on Jun 18, 2022. It is now read-only.

Commit b57396d

Browse files
author
armab
committed
Fix colorized string pad
1 parent a32db1a commit b57396d

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

lib/cli/cli.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,13 +203,14 @@ function safe_substr( $str, $start, $length = false ) {
203203
*/
204204
function safe_str_pad( $string, $length ) {
205205
// Hebrew vowel characters
206-
$cleaned_string = preg_replace( '#[\x{591}-\x{5C7}]+#u', '', $string );
206+
$cleaned_string = preg_replace( '#[\x{591}-\x{5C7}]+#u', '', Colors::decolorize( $string ) );
207207
if ( function_exists( 'mb_strwidth' ) ) {
208208
$real_length = mb_strwidth( $cleaned_string, mb_detect_encoding( $string ) );
209209
} else {
210210
$real_length = safe_strlen( $cleaned_string );
211211
}
212212
$diff = strlen( $string ) - $real_length;
213213
$length += $diff;
214+
214215
return str_pad( $string, $length );
215216
}

0 commit comments

Comments
 (0)