From: Tim Starling Date: Fri, 9 Dec 2011 06:03:27 +0000 (+0000) Subject: Revert r102504 (allow ESC in debug output): the justification in the comment above... X-Git-Tag: 1.31.0-rc.0~26112 X-Git-Url: https://git.cyclocoop.org/admin/?a=commitdiff_plain;h=4be17a47f4b9b8cebb95fba83ebe095a8dfecec1;p=lhc%2Fweb%2Fwiklou.git Revert r102504 (allow ESC in debug output): the justification in the comment above seems very reasonable to me, and is in fact an argument for stripping only ESC, since that's the only character that can change terminal modes. You could always make a highlighter pipe script for your wfDebugGreen(), instead of tailing the log directly. --- diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 7624887516..3223a55886 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -830,7 +830,7 @@ function wfDebug( $text, $logonly = false ) { if ( $wgDebugLogFile != '' && !$wgProfileOnly ) { # Strip unprintables; they can switch terminal modes when binary data # gets dumped, which is pretty annoying. - $text = preg_replace( '![\x00-\x08\x0b\x0c\x0e-\x1a\x1c-\x1f]!', ' ', $text ); + $text = preg_replace( '![\x00-\x08\x0b\x0c\x0e-\x1f]!', ' ', $text ); $text = $wgDebugLogPrefix . $text; wfErrorLog( $text, $wgDebugLogFile ); }