}
/** 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) {
set_schema($_GET["ns"]);
}
}
- if ($_GET["ns"] !== "") {
+ if ($_GET["ns"] !== "" && $missing != "ns") {
$tables = tables_list();
if (!$tables) {
echo "<p class='message'>" . lang('No tables.') . "\n";
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;
+ }
}
}
/** Print HTML footer
-* @param string auth|db
+* @param string "auth", "db", "ns"
* @return null
*/
function page_footer($missing = "") {
'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',
</p>
</form>
<?php
- if ($missing != "db") {
+ if ($missing != "db" && $missing != "ns") {
$table_status = table_status();
if (!$table_status) {
echo "<p class='message'>" . lang('No tables.') . "\n";