From: Jakub Vrana Date: Tue, 18 Sep 2018 11:13:34 +0000 (+0200) Subject: ClickHouse: Fix escaping X-Git-Tag: v4.7.0~32 X-Git-Url: https://git.joonet.de/?a=commitdiff_plain;h=0234fe4a66650fb864e8c2e69821fe0a6e8e4e0f;p=adminer.git ClickHouse: Fix escaping --- diff --git a/adminer/drivers/clickhouse.inc.php b/adminer/drivers/clickhouse.inc.php index d2e50d8c..3769119e 100644 --- a/adminer/drivers/clickhouse.inc.php +++ b/adminer/drivers/clickhouse.inc.php @@ -63,7 +63,7 @@ if (isset($_GET["clickhouse"])) { } function quote($string) { - return "'$string'"; + return "'" . addcslashes($string, "\\'") . "'"; } function multi_query($query) { @@ -242,7 +242,7 @@ if (isset($_GET["clickhouse"])) { function table_status($name = "", $fast = false) { global $connection; $return = array(); - $tables = get_rows("SELECT name, engine FROM system.tables WHERE database = '{$connection->_db}'"); + $tables = get_rows("SELECT name, engine FROM system.tables WHERE database = " . q($connection->_db)); foreach ($tables as $table) { $return[$table['name']] = array( 'Name' => $table['name'],