From 2e4a7121a997d35eefa976d57e197ee3a7a52c59 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Mon, 24 Jun 2013 05:53:23 -0700 Subject: [PATCH] Fix title and links on invalid table pages --- adminer/edit.inc.php | 2 +- adminer/include/functions.inc.php | 10 ++++++++++ adminer/select.inc.php | 2 +- adminer/table.inc.php | 2 +- changes.txt | 1 + 5 files changed, 14 insertions(+), 3 deletions(-) diff --git a/adminer/edit.inc.php b/adminer/edit.inc.php index 856d8d44..f7e2350d 100644 --- a/adminer/edit.inc.php +++ b/adminer/edit.inc.php @@ -55,7 +55,7 @@ if ($_POST && !$error && !isset($_GET["select"])) { } } -$table_name = $adminer->tableName(table_status($TABLE, true)); +$table_name = $adminer->tableName(table_status1($TABLE, true)); page_header( ($update ? lang('Edit') : lang('Insert')), $error, diff --git a/adminer/include/functions.inc.php b/adminer/include/functions.inc.php index f9918a6d..b50cdc8a 100644 --- a/adminer/include/functions.inc.php +++ b/adminer/include/functions.inc.php @@ -707,6 +707,16 @@ function hidden_fields_get() { echo ''; } +/** Get status of a single table and fall back to name on error +* @param string +* @param bool +* @return array +*/ +function table_status1($table, $fast = false) { + $return = table_status($table, $fast); + return ($return ? $return : array("Name" => $table)); +} + /** Find out foreign keys for each column * @param string * @return array array($col => array()) diff --git a/adminer/select.inc.php b/adminer/select.inc.php index 8b4b2296..94016631 100644 --- a/adminer/select.inc.php +++ b/adminer/select.inc.php @@ -1,6 +1,6 @@