MWDebugTest: disable MWDebug on test teardown
[lhc/web/wiklou.git] / includes / debug / MWDebug.php
index 81770d5..d90ef8a 100644 (file)
@@ -75,6 +75,15 @@ class MWDebug {
                self::$enabled = true;
        }
 
+       /**
+        * Disable the debugger.
+        *
+        * @since 1.28
+        */
+       public static function deinit() {
+               self::$enabled = false;
+       }
+
        /**
         * Add ResourceLoader modules to the OutputPage object if debugging is
         * enabled.
@@ -368,6 +377,9 @@ class MWDebug {
                        $sql
                );
 
+               // last check for invalid utf8
+               $sql = UtfNormal\Validator::cleanUp( $sql );
+
                self::$query[] = [
                        'sql' => $sql,
                        'function' => $function,