From 5b38a5b6f1bfbdfd98f6609e4ac19c096f9a5922 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Mon, 12 Jan 2015 09:46:53 -0800 Subject: [PATCH] Avoid double escaping in script=db (thanks to trestna smradlavice) --- adminer/script.inc.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/adminer/script.inc.php b/adminer/script.inc.php index 62df6eae..d36f03df 100644 --- a/adminer/script.inc.php +++ b/adminer/script.inc.php @@ -4,16 +4,15 @@ header("Content-Type: text/javascript; charset=utf-8"); if ($_GET["script"] == "db") { $sums = array("Data_length" => 0, "Index_length" => 0, "Data_free" => 0); foreach (table_status() as $name => $table_status) { - $id = js_escape($name); - json_row("Comment-$id", nbsp($table_status["Comment"])); + json_row("Comment-$name", nbsp($table_status["Comment"])); if (!is_view($table_status)) { foreach (array("Engine", "Collation") as $key) { - json_row("$key-$id", nbsp($table_status[$key])); + json_row("$key-$name", nbsp($table_status[$key])); } foreach ($sums + array("Auto_increment" => 0, "Rows" => 0) as $key => $val) { if ($table_status[$key] != "") { $val = format_number($table_status[$key]); - json_row("$key-$id", ($key == "Rows" && $val && $table_status["Engine"] == ($sql == "pgsql" ? "table" : "InnoDB") + json_row("$key-$name", ($key == "Rows" && $val && $table_status["Engine"] == ($sql == "pgsql" ? "table" : "InnoDB") ? "~ $val" : $val )); @@ -22,7 +21,7 @@ if ($_GET["script"] == "db") { $sums[$key] += ($table_status["Engine"] != "InnoDB" || $key != "Data_free" ? $table_status[$key] : 0); } } elseif (array_key_exists($key, $table_status)) { - json_row("$key-$id"); + json_row("$key-$name"); } } }