diff --git a/adminer/create.inc.php b/adminer/create.inc.php index 0e4e183d..ce5bb3b0 100644 --- a/adminer/create.inc.php +++ b/adminer/create.inc.php @@ -90,6 +90,11 @@ while ($row = $result->fetch_assoc()) { } $result->free(); +$row = array( + "Engine" => $_COOKIE["adminer_engine"], + "fields" => array(array("field" => "")), + "partition_names" => array(""), +); if ($_POST) { $row = $_POST; if ($row["auto_increment_col"]) { @@ -116,12 +121,6 @@ if ($_POST) { $result->free(); $row["partition_names"][] = ""; } -} else { - $row = array( - "Engine" => $_COOKIE["adminer_engine"], - "fields" => array(array("field" => "")), - "partition_names" => array(""), - ); } $collations = collations(); diff --git a/adminer/foreign.inc.php b/adminer/foreign.inc.php index 342c13a0..7e46238a 100644 --- a/adminer/foreign.inc.php +++ b/adminer/foreign.inc.php @@ -21,6 +21,7 @@ if ($_POST && !$error && !$_POST["add"] && !$_POST["change"] && !$_POST["change- page_header(lang('Foreign key'), $error, array("table" => $_GET["foreign"]), $_GET["foreign"]); +$row = array("table" => $_GET["foreign"], "source" => array("")); if ($_POST) { $row = $_POST; ksort($row["source"]); @@ -33,8 +34,6 @@ if ($_POST) { $foreign_keys = foreign_keys($_GET["foreign"]); $row = $foreign_keys[$_GET["name"]]; $row["source"][] = ""; -} else { - $row = array("table" => $_GET["foreign"], "source" => array("")); } $source = get_vals("SHOW COLUMNS FROM " . idf_escape($_GET["foreign"])); //! no text and blob diff --git a/adminer/include/auth.inc.php b/adminer/include/auth.inc.php index fffa9970..0b99c7b2 100644 --- a/adminer/include/auth.inc.php +++ b/adminer/include/auth.inc.php @@ -42,7 +42,7 @@ function auth_error($exception = null) { unset($_SESSION["usernames"][$_GET["server"]]); page_header(lang('Login'), (isset($username) ? htmlspecialchars($exception ? $exception->getMessage() : (is_string($dbh) ? $dbh : lang('Invalid credentials.'))) : (isset($_POST["server"]) ? lang('Sessions must be enabled.') : ($_POST ? lang('Session expired, please login again.') : ""))), null); echo "
\n"; - $adminer->loginForm($login); + $adminer->loginForm($username); echo "

\n"; hidden_fields($_POST, $ignore); // expired session foreach ($_FILES as $key => $val) { diff --git a/adminer/include/bootstrap.inc.php b/adminer/include/bootstrap.inc.php index 5aa4a932..15f212c2 100644 --- a/adminer/include/bootstrap.inc.php +++ b/adminer/include/bootstrap.inc.php @@ -82,6 +82,7 @@ include "./include/editing.inc.php"; include "./include/export.inc.php"; $confirm = " onclick=\"return confirm('" . lang('Are you sure?') . "');\""; +$enum_length = '\'(?:\'\'|[^\'\\\\]+|\\\\.)*\'|"(?:""|[^"\\\\]+|\\\\.)*"'; $token = $_SESSION["tokens"][$_GET["server"]]; $error = ($_POST ? ($_POST["token"] == $token ? "" : lang('Invalid CSRF token. Send the form again.')) diff --git a/adminer/index.php b/adminer/index.php index 3e445478..73a96b23 100644 --- a/adminer/index.php +++ b/adminer/index.php @@ -8,7 +8,6 @@ include "./include/bootstrap.inc.php"; -$enum_length = '\'(?:\'\'|[^\'\\\\]+|\\\\.)*\'|"(?:""|[^"\\\\]+|\\\\.)*"'; $inout = array("IN", "OUT", "INOUT"); if (isset($_GET["download"])) {