diff --git a/adminer/edit.inc.php b/adminer/edit.inc.php index 138bae04..398e5c61 100644 --- a/adminer/edit.inc.php +++ b/adminer/edit.inc.php @@ -67,8 +67,9 @@ if ($fields) { echo "\n"; foreach ($fields as $name => $field) { echo ""; - $value = (!isset($row) ? ($_POST["clone"] && $field["auto_increment"] ? "" : ($where ? $field["default"] : null)) - : (strlen($row[$name]) && ($field["type"] == "enum" || $field["type"] == "set") ? intval($row[$name]) : $row[$name]) + $value = (isset($row) + ? (strlen($row[$name]) && ($field["type"] == "enum" || $field["type"] == "set") ? intval($row[$name]) : $row[$name]) + : ($_POST["clone"] && $field["auto_increment"] ? "" : ($where ? $field["default"] : false)) ); input($name, $field, $value); if (isset($_GET["default"]) && $field["type"] == "timestamp") { diff --git a/adminer/include/editing.inc.php b/adminer/include/editing.inc.php index cca23413..88d91c12 100644 --- a/adminer/include/editing.inc.php +++ b/adminer/include/editing.inc.php @@ -43,7 +43,7 @@ function input($name, $field, $value) { if ($field["null"] || isset($_GET["default"])) { array_unshift($options, "NULL"); } - echo (count($options) > 1 || isset($_GET["select"]) ? '' : " ") . '
" . htmlspecialchars($name) . "'; + echo (count($options) > 1 || isset($_GET["select"]) ? '' : " ") . ''; if ($field["type"] == "set") { //! 64 bits preg_match_all("~'((?:[^']+|'')*)'~", $field["length"], $matches); foreach ($matches[1] as $i => $val) {