]> git.joonet.de Git - adminer.git/commitdiff
Fix Save and continue edit
authorjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Thu, 15 Apr 2010 14:59:40 +0000 (14:59 +0000)
committerjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Thu, 15 Apr 2010 14:59:40 +0000 (14:59 +0000)
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1443 7c3ca157-0c34-0410-bff1-cbf682f78f5c

adminer/edit.inc.php
adminer/include/functions.inc.php

index 597a74455a9350177c25727a99397225b72bbdc3..f0fb7781b7ed8fd0dc46b0269460c2946c94ee88 100644 (file)
@@ -11,7 +11,7 @@ foreach ($fields as $name => $field) {
 if ($_POST && !$error && !isset($_GET["select"])) {
        $location = $_POST["referer"];
        if ($_POST["insert"]) { // continue edit or insert
-               $location = ($update ? ME . "&edit=" . urlencode($TABLE) . unique_idf($_POST["fields"] + $_GET["where"], indexes($TABLE)) : $_SERVER["REQUEST_URI"]); //! doesn't work with functions
+               $location = ($update ? null : $_SERVER["REQUEST_URI"]);
        } elseif (!ereg('^.+&select=.+$', $location)) {
                $location = ME . "select=" . urlencode($TABLE);
                $i = 0; // append &set converted to &where
index 42a46e96d9542eb1c3a50d2586f25cfc537ebd1d..a8f12cdfc52a92c11c0ce289fcef34ae11a56d9a 100644 (file)
@@ -217,7 +217,7 @@ function restart_session() {
 }
 
 /** Send Location header and exit
-* @param string
+* @param string null to only set a message
 * @param string
 * @return null
 */
@@ -226,8 +226,10 @@ function redirect($location, $message = null) {
                restart_session();
                $_SESSION["messages"][] = $message;
        }
-       header("Location: " . ($location != "" ? $location : "."));
-       exit;
+       if (isset($location)) {
+               header("Location: " . ($location != "" ? $location : "."));
+               exit;
+       }
 }
 
 /** Execute query and redirect if successful