Remove non UTF-8 chars from debug output
authorphysikerwelt <wiki@physikerwelt.de>
Mon, 3 Jun 2013 09:50:43 +0000 (09:50 +0000)
committerParent5446 <tylerromeo@gmail.com>
Thu, 6 Jun 2013 18:47:41 +0000 (18:47 +0000)
The debug output might contain non UTF-8 chars. Theses bad characters
are not compatible with the debug toolbar. As a result the debug
toolbar disappears. Non UTF-8 chars are being produced by the database
log that prints out binary fields for example.

Bug: 48951
Change-Id: I42f7a5c913b378c05b68970646c75894ca068ed9

includes/debug/Debug.php

index ec9a62a..e2cfa98 100644 (file)
@@ -310,7 +310,7 @@ class MWDebug {
                global $wgDebugComments, $wgShowDebug;
 
                if ( self::$enabled || $wgDebugComments || $wgShowDebug ) {
-                       self::$debug[] = rtrim( $str );
+                       self::$debug[] = rtrim( UtfNormal::cleanUp( $str ) );
                }
        }