diff --git a/adminer/edit.inc.php b/adminer/edit.inc.php index 6e419ba4..d88108be 100644 --- a/adminer/edit.inc.php +++ b/adminer/edit.inc.php @@ -98,13 +98,13 @@ if (isset($_GET["select"])) { hidden_fields(array("check" => (array) $_POST["check"], "clone" => $_POST["clone"], "all" => $_POST["all"])); } if ($fields) { - echo "\n"; + echo "\n"; if (!isset($_GET["select"])) { - echo '\n"; + echo '\n"; } } if ($update) { - echo "\n"; + echo "\n"; } ?> diff --git a/adminer/include/design.inc.php b/adminer/include/design.inc.php index 4d273cca..464c931a 100644 --- a/adminer/include/design.inc.php +++ b/adminer/include/design.inc.php @@ -14,6 +14,9 @@ function page_header($title, $error = "", $breadcrumb = array(), $title2 = "") { $title_page = $title_all . (SERVER != "" && SERVER != "localhost" ? h(" - " . SERVER) : "") . " - " . $adminer->name(); if (is_ajax()) { header("X-AJAX-Title: " . rawurlencode($title_page)); + if ($_GET["ajax"]) { + header("X-AJAX-Redirect: " . remove_from_uri("ajax")); + } } else { $protocol = ($HTTPS ? "https" : "http"); ?> diff --git a/adminer/include/functions.inc.php b/adminer/include/functions.inc.php index 58ef4fd1..2c62d12c 100644 --- a/adminer/include/functions.inc.php +++ b/adminer/include/functions.inc.php @@ -355,7 +355,7 @@ function auth_url($driver, $server, $username) { * @return bool */ function is_ajax() { - return ($_SERVER["HTTP_X_REQUESTED_WITH"] == "XMLHttpRequest"); + return ($_SERVER["HTTP_X_REQUESTED_WITH"] == "XMLHttpRequest" || $_GET["ajax"]); } /** Send Location header and exit @@ -372,12 +372,8 @@ function redirect($location, $message = null) { if ($location == "") { $location = "."; } - if (!is_ajax()) { - header("Location: $location"); - exit; - } - header("X-AJAX-Redirect: $location"); - $_POST = array(); + header("Location: $location" . (is_ajax() ? (strpos($location, "?") !== false ? "&" : "?") . "ajax=1" : "")); + exit; } } diff --git a/adminer/select.inc.php b/adminer/select.inc.php index 053c1d85..da191889 100644 --- a/adminer/select.inc.php +++ b/adminer/select.inc.php @@ -200,7 +200,7 @@ $adminer->selectLinks($table_status, $set); if (!$columns) { echo "
" . lang('Unable to select the table') . ($fields ? "." : ": " . error()) . "\n"; } else { - echo "