diff --git a/adminer/include/adminer.inc.php b/adminer/include/adminer.inc.php
index a9253eae..fd5956d7 100644
--- a/adminer/include/adminer.inc.php
+++ b/adminer/include/adminer.inc.php
@@ -491,7 +491,7 @@ document.getElementById('username').focus();
}
/** Prints navigation after Adminer title
- * @param string can be "auth" if there is no database connection or "db" if there is no database selected
+ * @param string can be "auth" if there is no database connection, "db" if there is no database selected, "ns" with invalid schema
* @return null
*/
function navigation($missing) {
@@ -544,7 +544,7 @@ document.getElementById('username').focus();
set_schema($_GET["ns"]);
}
}
- if ($_GET["ns"] !== "") {
+ if ($_GET["ns"] !== "" && $missing != "ns") {
$tables = tables_list();
if (!$tables) {
echo "
" . lang('No tables.') . "\n";
diff --git a/adminer/include/connect.inc.php b/adminer/include/connect.inc.php
index 64cd6254..1f58a6ef 100644
--- a/adminer/include/connect.inc.php
+++ b/adminer/include/connect.inc.php
@@ -60,6 +60,13 @@ if (!(DB != "" ? $connection->select_db(DB) : isset($_GET["sql"]) || isset($_GET
exit;
}
-if (support("scheme") && DB != "" && $_GET["ns"] !== "" && (!isset($_GET["ns"]) || !set_schema($_GET["ns"]))) {
- redirect(preg_replace('~ns=[^&]*&~', '', ME) . "ns=" . get_schema());
+if (support("scheme") && DB != "" && $_GET["ns"] !== "") {
+ if (!isset($_GET["ns"])) {
+ redirect(preg_replace('~ns=[^&]*&~', '', ME) . "ns=" . get_schema());
+ }
+ if (!set_schema($_GET["ns"])) {
+ page_header(lang('Schema') . ": " . h($_GET["ns"]), lang('Invalid schema.'), true);
+ page_footer("ns");
+ exit;
+ }
}
diff --git a/adminer/include/design.inc.php b/adminer/include/design.inc.php
index 445a7b24..81b40d11 100644
--- a/adminer/include/design.inc.php
+++ b/adminer/include/design.inc.php
@@ -73,7 +73,7 @@ function page_header($title, $error = "", $breadcrumb = array(), $title2 = "") {
}
/** Print HTML footer
-* @param string auth|db
+* @param string "auth", "db", "ns"
* @return null
*/
function page_footer($missing = "") {
diff --git a/adminer/lang/cs.inc.php b/adminer/lang/cs.inc.php
index 538de920..4c91e62a 100644
--- a/adminer/lang/cs.inc.php
+++ b/adminer/lang/cs.inc.php
@@ -262,6 +262,7 @@ $translations = array(
'Schema has been altered.' => 'Schéma bylo změněno.',
'schema' => 'schéma',
'Schema' => 'Schéma',
+ 'Invalid schema.' => 'Nesprávné schéma.',
// PostgreSQL sequences support
'Sequences' => 'Sekvence',
diff --git a/editor/include/adminer.inc.php b/editor/include/adminer.inc.php
index 7e80c937..ac99cc5b 100644
--- a/editor/include/adminer.inc.php
+++ b/editor/include/adminer.inc.php
@@ -463,7 +463,7 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5
" . lang('No tables.') . "\n";