From 9bb1909fcf3954ed093965c15abb39bf40617f1e Mon Sep 17 00:00:00 2001 From: jakubvrana Date: Thu, 15 Apr 2010 14:59:40 +0000 Subject: [PATCH] Fix Save and continue edit git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1443 7c3ca157-0c34-0410-bff1-cbf682f78f5c --- adminer/edit.inc.php | 2 +- adminer/include/functions.inc.php | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/adminer/edit.inc.php b/adminer/edit.inc.php index 597a7445..f0fb7781 100644 --- a/adminer/edit.inc.php +++ b/adminer/edit.inc.php @@ -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 diff --git a/adminer/include/functions.inc.php b/adminer/include/functions.inc.php index 42a46e96..a8f12cdf 100644 --- a/adminer/include/functions.inc.php +++ b/adminer/include/functions.inc.php @@ -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