Skip to content

Commit f21abd4

Browse files
Don't unnecessarily clobber % characters passed through colorize
1 parent 4de0c96 commit f21abd4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/cli/Colors.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,9 @@ static public function colorize($string, $colored = null) {
120120
}
121121

122122
if (!self::shouldColorize($colored)) {
123-
$return = preg_replace('/%((%)|.)/', '$2', $string);
123+
$colors = self::getColors();
124+
$search = array_keys( $colors );
125+
$return = str_replace( $search, '', $string );
124126
self::cacheString($passed, $return, $colored);
125127
return $return;
126128
}

0 commit comments

Comments
 (0)