Fix Save and continue edit
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1443 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
parent
186c05898f
commit
9bb1909fcf
|
@ -11,7 +11,7 @@ foreach ($fields as $name => $field) {
|
||||||
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
|
||||||
|
|
|
@ -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
|
||||||
*/
|
*/
|
||||||
|
@ -226,9 +226,11 @@ function redirect($location, $message = null) {
|
||||||
restart_session();
|
restart_session();
|
||||||
$_SESSION["messages"][] = $message;
|
$_SESSION["messages"][] = $message;
|
||||||
}
|
}
|
||||||
|
if (isset($location)) {
|
||||||
header("Location: " . ($location != "" ? $location : "."));
|
header("Location: " . ($location != "" ? $location : "."));
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/** Execute query and redirect if successful
|
/** Execute query and redirect if successful
|
||||||
* @param string
|
* @param string
|
||||||
|
|
Loading…
Reference in a new issue