]> git.joonet.de Git - adminer.git/commitdiff
ClickHouse: Fix escaping
authorJakub Vrana <jakub@vrana.cz>
Tue, 18 Sep 2018 11:13:34 +0000 (13:13 +0200)
committerJakub Vrana <jakub@vrana.cz>
Tue, 18 Sep 2018 11:13:34 +0000 (13:13 +0200)
adminer/drivers/clickhouse.inc.php

index d2e50d8cd10e5cf88ccfd36b09526e39c1bd713f..3769119e93a9d07b7926b84793ace799d4846695 100644 (file)
@@ -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'],