@@ -129,16 +129,17 @@ public function row( array $row ) {
129
129
$ value = str_replace ( PHP_EOL , ' ' , $ value );
130
130
131
131
$ col_width = $ this ->_widths [ $ col ];
132
- $ val_width = Colors::length ( $ value );
133
- if ( Colors:: length ( $ value ) > $ col_width ) {
132
+ $ original_val_width = Colors::length ( $ value );
133
+ if ( $ original_val_width > $ col_width ) {
134
134
$ row [ $ col ] = mb_substr ( $ value , 0 , $ col_width , mb_detect_encoding ( $ value ) );
135
- $ value = mb_substr ( $ value , $ col_width , null , mb_detect_encoding ( $ value ) );
135
+ $ value = mb_substr ( $ value , $ col_width , $ original_val_width , mb_detect_encoding ( $ value ) );
136
136
$ i = 0 ;
137
137
do {
138
138
$ extra_value = mb_substr ( $ value , 0 , $ col_width , mb_detect_encoding ( $ value ) );
139
- if ( mb_strlen ( $ extra_value , mb_detect_encoding ( $ extra_value ) ) ) {
139
+ $ val_width = mb_strlen ( $ extra_value , mb_detect_encoding ( $ extra_value ) );
140
+ if ( $ val_width ) {
140
141
$ extra_rows [ $ col ][] = $ extra_value ;
141
- $ value = mb_substr ( $ value , $ col_width , null , mb_detect_encoding ( $ value ) );
142
+ $ value = mb_substr ( $ value , $ col_width , $ original_val_width , mb_detect_encoding ( $ value ) );
142
143
$ i ++;
143
144
if ( $ i > $ extra_row_count ) {
144
145
$ extra_row_count = $ i ;
0 commit comments