From eb885c443c4c21cf33d6b030c0303e695e2c3e18 Mon Sep 17 00:00:00 2001 From: Shish Date: Sun, 7 Jul 2019 19:22:44 +0100 Subject: [PATCH] trim leading whitespace when logging queries --- core/database.php | 1 + 1 file changed, 1 insertion(+) diff --git a/core/database.php b/core/database.php index 7bfd365a..003816d4 100644 --- a/core/database.php +++ b/core/database.php @@ -192,6 +192,7 @@ class Database { global $_tracer; $dur = microtime(true) - $start; + $query = trim(preg_replace('/^[\t ]+/m', '', $query)); // trim leading whitespace $_tracer->complete($start * 1000000, $dur * 1000000, "DB Query", ["query"=>$query, "args"=>$args, "method"=>$method]); $this->query_count++; $this->dbtime += $dur;