From 4be17a47f4b9b8cebb95fba83ebe095a8dfecec1 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Fri, 9 Dec 2011 06:03:27 +0000 Subject: [PATCH] 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. --- includes/GlobalFunctions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 ); } -- 2.20.1