Permalink
Browse files

Return to referer after edit

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1339 7c3ca157-0c34-0410-bff1-cbf682f78f5c
  • Loading branch information...
1 parent c1c1b60 commit b681dfbbff44d3163ddce8cc1821b936196bcc0f jakubvrana committed Mar 5, 2010
Showing with 19 additions and 4 deletions.
  1. +1 −2 adminer/call.inc.php
  2. +5 −2 adminer/edit.inc.php
  3. +4 −0 changes.txt
  4. +8 −0 editor/include/editing.inc.php
  5. +1 −0 todo.txt
View
@@ -28,8 +28,7 @@
}
$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
@@ -9,8 +9,10 @@
}
}
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 @@
?>
<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
@@ -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
@@ -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
@@ -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

0 comments on commit b681dfb

Please sign in to comment.