]> git.joonet.de Git - adminer.git/commitdiff
Clear POST with AJAX redirect
authorJakub Vrana <jakub@vrana.cz>
Sun, 17 Oct 2010 22:05:39 +0000 (00:05 +0200)
committerJakub Vrana <jakub@vrana.cz>
Sun, 17 Oct 2010 22:05:39 +0000 (00:05 +0200)
adminer/include/functions.inc.php
adminer/select.inc.php

index f4ab0c3ebe954565a3336e375aeb16f31ddddc98..9bb5ce18f18c73ef0f4e56a3b74e258505f7616f 100644 (file)
@@ -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();
        }
 }
 
index 2bcac10d533ef0454af48bb473b3e6bee9f7b822..73430d08d655ade82b19b56662cb0ae0948fc636 100644 (file)
@@ -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, "<i>...</i>");
                                                $editable = is_utf8($val) && !$long && $rows[$n][$key] == $row[$key] && !$functions[$key];