--- a/install/includes/cli-core.php Tue Jun 02 13:27:05 2009 -0400
+++ b/install/includes/cli-core.php Fri Jun 05 22:09:42 2009 -0400
@@ -782,9 +782,16 @@
function parse_shellcolor_string($str)
{
+ // only compute this once (saves some CPU time)
+ static $do_colors = null;
+ if ( $do_colors === null )
+ {
+ $do_colors = ( isset($_SERVER['TERM']) && $_SERVER['TERM'] != 'dumb' );
+ }
+
$expr = '/<c ((?:[0-9]+)(?:;[0-9]+)*)>([\w\W]*?)<\/c>/';
while ( preg_match($expr, $str) )
- $str = preg_replace($expr, "\x1B[\\1m\\2\x1B[0m", $str);
+ $str = $do_colors ? preg_replace($expr, "\x1B[\\1m\\2\x1B[0m", $str) : preg_replace($expr, "\\2", $str);
return $str;
}