Permalink
Browse files

Clear POST with AJAX redirect

  • Loading branch information...
1 parent a93e069 commit de24145d8100a3be4bd272007b5b8d51bff78008 @vrana committed Oct 17, 2010
Showing with 7 additions and 4 deletions.
  1. +6 −3 adminer/include/functions.inc.php
  2. +1 −1 adminer/select.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();
}
}
View
@@ -333,7 +333,7 @@
}
}
$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, "<i>...</i>");
$editable = is_utf8($val) && !$long && $rows[$n][$key] == $row[$key] && !$functions[$key];

0 comments on commit de24145

Please sign in to comment.