diff --git a/adminer/create.inc.php b/adminer/create.inc.php index f728bdc7..dc408f8c 100644 --- a/adminer/create.inc.php +++ b/adminer/create.inc.php @@ -65,7 +65,10 @@ if ($_POST && !$error && !$_POST["add"] && !$_POST["drop_col"] && !$_POST["up"] $partitions[] = "\nPARTITION " . idf_escape($val) . " VALUES " . ($_POST["partition_by"] == 'RANGE' ? "LESS THAN" : "IN") . (strlen($value) ? " ($value)" : " MAXVALUE"); //! SQL injection } } - $status .= "\nPARTITION BY $_POST[partition_by]($_POST[partition])" . ($partitions ? " (" . implode(",", $partitions) . "\n)" : ($_POST["partitions"] ? " PARTITIONS " . intval($_POST["partitions"]) : "")); // $_POST["partition"] can be expression, not only column + $status .= "\nPARTITION BY $_POST[partition_by]($_POST[partition])" . ($partitions // $_POST["partition"] can be expression, not only column + ? " (" . implode(",", $partitions) . "\n)" + : ($_POST["partitions"] ? " PARTITIONS " . intval($_POST["partitions"]) : "") + ); } elseif ($dbh->server_info >= 5.1 && strlen($_GET["create"])) { $status .= "\nREMOVE PARTITIONING"; } @@ -79,6 +82,7 @@ if ($_POST && !$error && !$_POST["add"] && !$_POST["drop_col"] && !$_POST["up"] } } } + page_header((strlen($_GET["create"]) ? lang('Alter table') : lang('Create table')), $error, array("table" => $_GET["create"]), $_GET["create"]); $engines = array(); diff --git a/adminer/database.inc.php b/adminer/database.inc.php index e6bcd398..f807da57 100644 --- a/adminer/database.inc.php +++ b/adminer/database.inc.php @@ -38,6 +38,7 @@ if ($_POST && !$error && !isset($_POST["add_x"])) { // add is an image and PHP c query_redirect("ALTER DATABASE " . idf_escape($_POST["name"]) . " COLLATE " . $dbh->quote($_POST["collation"]), substr($SELF, 0, -1), lang('Database has been altered.')); } } + page_header(strlen($_GET["db"]) ? lang('Alter database') : lang('Create database'), $error, array(), $_GET["db"]); $collations = collations(); @@ -70,7 +71,10 @@ if ($_POST) {