From: Brion Vibber Date: Sun, 15 May 2005 06:09:40 +0000 (+0000) Subject: Strip unprintables from debug log: they can cause font switching on the X-Git-Tag: 1.5.0alpha2~191 X-Git-Url: http://git.cyclocoop.org/%24self?a=commitdiff_plain;h=2d297d4472c6cde985bb87ea9c8af1abc74089df;p=lhc%2Fweb%2Fwiklou.git Strip unprintables from debug log: they can cause font switching on the terminal which is annoying. --- diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index e1e9c2a617..3f9026a2e5 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -269,6 +269,9 @@ function wfDebug( $text, $logonly = false ) { $wgOut->debug( $text ); } 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-\x1f]!', ' ', $text ); @error_log( $text, 3, $wgDebugLogFile ); } }