diff --git a/adminer/include/functions.inc.php b/adminer/include/functions.inc.php index ea81a1c9..d3489447 100644 --- a/adminer/include/functions.inc.php +++ b/adminer/include/functions.inc.php @@ -345,7 +345,7 @@ function redirect($location, $message = null) { restart_session(); $_SESSION["messages"][] = $message; } - if (isset($location)) { + if (isset($location) && $_SERVER["HTTP_X_REQUESTED_WITH"] != "XMLHttpRequest") { header("Location: " . ($location != "" ? $location : ".")); exit; } diff --git a/adminer/select.inc.php b/adminer/select.inc.php index 8d118bcd..441681e6 100644 --- a/adminer/select.inc.php +++ b/adminer/select.inc.php @@ -333,7 +333,7 @@ if (!$columns) { } } $id = h("val[$unique_idf][" . bracket_escape($key) . "]"); - $value = $_POST["val"][$unique_idf][bracket_escape($key)]; + $value = ($error ? $_POST["val"][$unique_idf][bracket_escape($key)] : null); $h_value = h(isset($value) ? $value : $row[$key]); $long = strpos($val, "..."); $editable = is_utf8($val) && !$long && $rows[$n][$key] == $row[$key] && !$functions[$key]; @@ -380,7 +380,7 @@ if (!$columns) { if (!information_schema(DB)) { ?>