Save bytes
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1179 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
parent
ddb0a34b45
commit
4b3d569a6e
|
@ -55,7 +55,7 @@ if ($in) {
|
|||
$field = $routine["fields"][$key];
|
||||
echo "<tr><th>" . h($field["field"]);
|
||||
$value = $_POST["fields"][$key];
|
||||
if (strlen($value) && ($field["type"] == "enum" || $field["type"] == "set")) {
|
||||
if (strlen($value) && ereg("enum|set", $field["type"])) {
|
||||
$value = intval($value);
|
||||
}
|
||||
input($field, $value, (string) $_POST["function"][$name]); // param name can be empty
|
||||
|
|
|
@ -101,7 +101,7 @@ page_header((strlen($TABLE) ? lang('Alter table') : lang('Create table')), $erro
|
|||
$engines = array();
|
||||
$result = $connection->query("SHOW ENGINES");
|
||||
while ($row = $result->fetch_assoc()) {
|
||||
if ($row["Support"] == "YES" || $row["Support"] == "DEFAULT") {
|
||||
if (ereg("YES|DEFAULT", $row["Support"])) {
|
||||
$engines[] = $row["Engine"];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -51,7 +51,7 @@ if ($_POST["save"]) {
|
|||
$select = array();
|
||||
foreach ($fields as $name => $field) {
|
||||
if (isset($field["privileges"]["select"])) {
|
||||
$select[] = ($_POST["clone"] && $field["auto_increment"] ? "'' AS " : ($field["type"] == "enum" || $field["type"] == "set" ? "1*" . idf_escape($name) . " AS " : "")) . idf_escape($name);
|
||||
$select[] = ($_POST["clone"] && $field["auto_increment"] ? "'' AS " : (ereg("enum|set", $field["type"]) ? "1*" . idf_escape($name) . " AS " : "")) . idf_escape($name);
|
||||
}
|
||||
}
|
||||
$row = array();
|
||||
|
@ -71,7 +71,7 @@ if ($fields) {
|
|||
echo "<tr><th>" . $adminer->fieldName($field);
|
||||
$default = $_GET["set"][bracket_escape($name)];
|
||||
$value = (isset($row)
|
||||
? (strlen($row[$name]) && ($field["type"] == "enum" || $field["type"] == "set") ? intval($row[$name]) : $row[$name])
|
||||
? (strlen($row[$name]) && ereg("enum|set", $field["type"]) ? intval($row[$name]) : $row[$name])
|
||||
: ($_POST["clone"] && $field["auto_increment"] ? "" : (isset($_GET["select"]) ? false : (isset($default) ? $default : $field["default"])))
|
||||
);
|
||||
if (!$_POST["save"] && is_string($value)) {
|
||||
|
|
|
@ -138,7 +138,7 @@ function get_vals($query, $column = 0) {
|
|||
*/
|
||||
function unique_idf($row, $indexes) {
|
||||
foreach ($indexes as $index) {
|
||||
if ($index["type"] == "PRIMARY" || $index["type"] == "UNIQUE") {
|
||||
if (ereg("PRIMARY|UNIQUE", $index["type"])) {
|
||||
$return = array();
|
||||
foreach ($index["columns"] as $key) {
|
||||
if (!isset($row[$key])) { // NULL is ambiguous
|
||||
|
|
Loading…
Reference in a new issue