diff --git a/adminer/include/adminer.inc.php b/adminer/include/adminer.inc.php new file mode 100644 index 00000000..7aaf2d67 --- /dev/null +++ b/adminer/include/adminer.inc.php @@ -0,0 +1,18 @@ +' . lang('select') . ' '; + echo '' . $this->table_name($row) . "
\n"; + } + + function table_name($row) { + return htmlspecialchars($row["Name"]); + } + + function field_name($fields, $key) { + return htmlspecialchars($key); + } + +} diff --git a/adminer/include/design.inc.php b/adminer/include/design.inc.php index 0fd0676f..402bd30b 100644 --- a/adminer/include/design.inc.php +++ b/adminer/include/design.inc.php @@ -56,7 +56,7 @@ function page_header($title, $error = "", $breadcrumb = array(), $title2 = "") { } function page_footer($missing = false) { - global $SELF, $VERSION, $dbh; + global $SELF, $VERSION, $dbh, $adminer; ?> @@ -95,8 +95,7 @@ function page_footer($missing = false) { } else { echo "

\n"; foreach ($table_status as $row) { - echo '' . lang('select') . ' '; - echo '' . htmlspecialchars($row["Name"]) . "
\n"; + $adminer->table_list($row); } echo "

\n"; } diff --git a/adminer/index.php b/adminer/index.php index e78ade13..9d5fd898 100644 --- a/adminer/index.php +++ b/adminer/index.php @@ -87,6 +87,7 @@ include "./include/version.inc.php"; include "./include/functions.inc.php"; include "./include/lang.inc.php"; include "./lang/$LANG.inc.php"; +include "./include/adminer.inc.php"; include "./include/design.inc.php"; if (isset($_GET["coverage"])) { include "./coverage.inc.php"; @@ -98,6 +99,7 @@ include "./include/connect.inc.php"; include "./include/editing.inc.php"; include "./include/export.inc.php"; +$adminer = (class_exists("Adminer") ? new Adminer : new AdminerBase); $on_actions = array("RESTRICT", "CASCADE", "SET NULL", "NO ACTION"); $enum_length = '\'(?:\'\'|[^\'\\\\]+|\\\\.)*\'|"(?:""|[^"\\\\]+|\\\\.)*"'; $inout = array("IN", "OUT", "INOUT"); diff --git a/adminer/select.inc.php b/adminer/select.inc.php index e54b4f28..2d6b3f47 100644 --- a/adminer/select.inc.php +++ b/adminer/select.inc.php @@ -143,7 +143,7 @@ if ($_POST && !$error) { $error = lang('Unable to upload a file.'); } } -page_header(lang('Select') . ": " . htmlspecialchars($_GET["select"]), $error); +page_header(lang('Select') . ": " . $adminer->table_name($table_status), $error); echo "

"; if (isset($rights["insert"])) { @@ -250,7 +250,7 @@ if (!$columns) { if (!$j) { echo ''; foreach ($row as $key => $val) { - echo '' . htmlspecialchars($key) . ''; + echo '' . $adminer->field_name($fields, $key) . ''; } echo "\n"; }