Return to referer after edit

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1339 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
jakubvrana 2010-03-05 16:18:45 +00:00
parent c1c1b605cf
commit b681dfbbff
5 changed files with 19 additions and 4 deletions

View file

@ -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 "<p class='error'>" . error() . "\n";
} else {
do {

View file

@ -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) {
?>
<p>
<input type="hidden" name="token" value="<?php echo $token; ?>">
<input type="hidden" name="referer" value="<?php echo h(isset($_POST["referer"]) ? $_POST["referer"] : $_SERVER["HTTP_REFERER"]); ?>">
<input type="hidden" name="save" value="1">
<?php
if (isset($_GET["select"])) {

View file

@ -1,3 +1,7 @@
Adminer 2.3.1-dev:
Add Drop button to Alter pages (regression from 2.0.0)
Return to referer after edit
Adminer 2.3.0 (released 2010-02-26):
Support for permanent login (customization required)
Search in all tables

View file

@ -1,9 +1,17 @@
<?php
/** Encode e-mail header in UTF-8
* @param string
* @return string
*/
function email_header($header) {
// iconv_mime_encode requires PHP 5, imap_8bit requires IMAP extension
return "=?UTF-8?B?" . base64_encode($header) . "?="; //! split long lines
}
/** Get keys from first column and values from second
* @param string
* @return array
*/
function get_key_vals($query) {
global $connection;
$return = array();

View file

@ -12,6 +12,7 @@ Highlight SQL textarea, then display query inside textarea in select - may use e
Blob download and image display in edit form (important for Editor with hidden fields in select)
Add title to Logout, edit (in select) and select (in menu) in style "hever"
Shift-click in checkboxes to select range
? LIKE %% operator
? Column and table names auto-completition in SQL textarea
? Aliasing of built-in functions can save 7 KB, function minification can save 7 KB, substitution of repetitive $a["a"] can save 4 KB, substitution of $_GET and friends can save 2 KB, JS packer can save 1 KB, not enclosing HTML attribute values can save 1.2 KB, replacing \\n by \n can save .3 KB
? Branch binary_compile: LZW compression of translations can save 30 KB, LZW compression of all texts can save 11 KB, remove of base64_decode() + using chars 127-255 in minification can save 1 KB