From de24145d8100a3be4bd272007b5b8d51bff78008 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Mon, 18 Oct 2010 00:05:39 +0200 Subject: [PATCH] Clear POST with AJAX redirect --- adminer/include/functions.inc.php | 9 ++++++--- adminer/select.inc.php | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) 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];