Skip to content

Commit

Permalink
Fix Save and continue edit
Browse files Browse the repository at this point in the history
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1443 7c3ca157-0c34-0410-bff1-cbf682f78f5c
  • Loading branch information
jakubvrana committed Apr 15, 2010
1 parent 186c058 commit 9bb1909
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion adminer/edit.inc.php
Expand Up @@ -11,7 +11,7 @@
if ($_POST && !$error && !isset($_GET["select"])) { if ($_POST && !$error && !isset($_GET["select"])) {
$location = $_POST["referer"]; $location = $_POST["referer"];
if ($_POST["insert"]) { // continue edit or insert 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)) { } elseif (!ereg('^.+&select=.+$', $location)) {
$location = ME . "select=" . urlencode($TABLE); $location = ME . "select=" . urlencode($TABLE);
$i = 0; // append &set converted to &where $i = 0; // append &set converted to &where
Expand Down
8 changes: 5 additions & 3 deletions adminer/include/functions.inc.php
Expand Up @@ -217,7 +217,7 @@ function restart_session() {
} }


/** Send Location header and exit /** Send Location header and exit
* @param string * @param string null to only set a message
* @param string * @param string
* @return null * @return null
*/ */
Expand All @@ -226,8 +226,10 @@ function redirect($location, $message = null) {
restart_session(); restart_session();
$_SESSION["messages"][] = $message; $_SESSION["messages"][] = $message;
} }
header("Location: " . ($location != "" ? $location : ".")); if (isset($location)) {
exit; header("Location: " . ($location != "" ? $location : "."));
exit;
}
} }


/** Execute query and redirect if successful /** Execute query and redirect if successful
Expand Down

0 comments on commit 9bb1909

Please sign in to comment.