From: Jakub Vrana Date: Sun, 17 Oct 2010 22:05:39 +0000 (+0200) Subject: Clear POST with AJAX redirect X-Git-Tag: v3.2.0~140^2~21 X-Git-Url: https://git.joonet.de/?a=commitdiff_plain;h=de24145d8100a3be4bd272007b5b8d51bff78008;p=adminer.git Clear POST with AJAX redirect --- diff --git a/adminer/include/functions.inc.php b/adminer/include/functions.inc.php index f4ab0c3e..9bb5ce18 100644 --- a/adminer/include/functions.inc.php +++ b/adminer/include/functions.inc.php @@ -345,9 +345,12 @@ function redirect($location, $message = null) { restart_session(); $_SESSION["messages"][] = $message; } - if (isset($location) && $_SERVER["HTTP_X_REQUESTED_WITH"] != "XMLHttpRequest") { - header("Location: " . ($location != "" ? $location : ".")); - exit; + if (isset($location)) { + if ($_SERVER["HTTP_X_REQUESTED_WITH"] != "XMLHttpRequest") { + header("Location: " . ($location != "" ? $location : ".")); + exit; + } + $_POST = array(); } } diff --git a/adminer/select.inc.php b/adminer/select.inc.php index 2bcac10d..73430d08 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 = ($error ? $_POST["val"][$unique_idf][bracket_escape($key)] : null); + $value = $_POST["val"][$unique_idf][bracket_escape($key)]; $h_value = h(isset($value) ? $value : $row[$key]); $long = strpos($val, "..."); $editable = is_utf8($val) && !$long && $rows[$n][$key] == $row[$key] && !$functions[$key];