]> git.joonet.de Git - adminer.git/commitdiff
Fix title and links on invalid table pages
authorJakub Vrana <jakub@vrana.cz>
Mon, 24 Jun 2013 12:53:23 +0000 (05:53 -0700)
committerJakub Vrana <jakub@vrana.cz>
Mon, 24 Jun 2013 12:53:23 +0000 (05:53 -0700)
adminer/edit.inc.php
adminer/include/functions.inc.php
adminer/select.inc.php
adminer/table.inc.php
changes.txt

index 856d8d442551f397868dcd23d640d2cfa5cd0e25..f7e2350d09eb60df28ef69272f2bc2fd1fe7f6c5 100644 (file)
@@ -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,
index f9918a6d386689398bb4ae57411a46a251843b5d..b50cdc8a7de21024ca4138f6c0198510f9fa35cf 100644 (file)
@@ -707,6 +707,16 @@ function hidden_fields_get() {
        echo '<input type="hidden" name="username" value="' . h($_GET["username"]) . '">';
 }
 
+/** 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())
index 8b4b2296fcedbae8ee36f271b02178515fd87f3a..940166316b685a6d7503cfe8417701ed45a8a786 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 $TABLE = $_GET["select"];
-$table_status = table_status($TABLE);
+$table_status = table_status1($TABLE);
 $indexes = indexes($TABLE);
 $fields = fields($TABLE);
 $foreign_keys = column_foreign_keys($TABLE);
index 9033b5e9721127a79bfd9585a46afea149070f70..bcd8281bbaef91b7a428b5735d85e17fe779ce8b 100644 (file)
@@ -4,7 +4,7 @@ $fields = fields($TABLE);
 if (!$fields) {
        $error = error();
 }
-$table_status = table_status($TABLE, true);
+$table_status = table_status1($TABLE, true);
 
 page_header(($fields && is_view($table_status) ? lang('View') : lang('Table')) . ": " . h($TABLE), $error);
 
index e982e4f5a6fc0f8a6a4957d3f853209788a79244..b15e0800460b451a4a4482b45421ba0522c7c05d 100644 (file)
@@ -7,6 +7,7 @@ Order table list by name
 Verify UTF-8 encoding of CSV import
 Notify user about expired master password for permanent login
 Send 404 for invalid database and schema
+Fix title and links on invalid table pages
 MySQL: Speed up updating rows without numeric or UTF-8 primary key
 PostgreSQL: Fix detecting oid column in PDO
 PostgreSQL: Handle timestamp types (bug #3614086)