From b681dfbbff44d3163ddce8cc1821b936196bcc0f Mon Sep 17 00:00:00 2001 From: jakubvrana Date: Fri, 5 Mar 2010 16:18:45 +0000 Subject: [PATCH] Return to referer after edit git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1339 7c3ca157-0c34-0410-bff1-cbf682f78f5c --- adminer/call.inc.php | 3 +-- adminer/edit.inc.php | 7 +++++-- changes.txt | 4 ++++ editor/include/editing.inc.php | 8 ++++++++ todo.txt | 1 + 5 files changed, 19 insertions(+), 4 deletions(-) diff --git a/adminer/call.inc.php b/adminer/call.inc.php index 0f7fe0fe..039868d8 100644 --- a/adminer/call.inc.php +++ b/adminer/call.inc.php @@ -28,8 +28,7 @@ if (!$error && $_POST) { } $call[] = (isset($out[$key]) ? "@" . idf_escape($field["field"]) : $val); } - $result = $connection->multi_query((isset($_GET["callf"]) ? "SELECT" : "CALL") . " " . idf_escape($PROCEDURE) . "(" . implode(", ", $call) . ")"); - if (!$result) { + if (!$connection->multi_query((isset($_GET["callf"]) ? "SELECT" : "CALL") . " " . idf_escape($PROCEDURE) . "(" . implode(", ", $call) . ")")) { echo "

" . error() . "\n"; } else { do { diff --git a/adminer/edit.inc.php b/adminer/edit.inc.php index 005ab64e..edae47b5 100644 --- a/adminer/edit.inc.php +++ b/adminer/edit.inc.php @@ -9,8 +9,10 @@ foreach ($fields as $name => $field) { } } if ($_POST && !$error && !isset($_GET["select"])) { - $location = $_SERVER["REQUEST_URI"]; // continue edit or insert - if (!$_POST["insert"]) { + $location = $_POST["referer"]; + if ($_POST["insert"]) { // continue edit or insert + $location = $_SERVER["REQUEST_URI"]; //! doesn't work with change in &where field + } elseif (!ereg('^.+&select=.+$', $location)) { $location = ME . "select=" . urlencode($TABLE); $i = 0; // append &set converted to &where foreach ((array) $_GET["set"] as $key => $val) { @@ -96,6 +98,7 @@ if ($fields) { ?>

+">