$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");
?>
* @return bool
*/
function is_ajax() {
- return ($_SERVER["HTTP_X_REQUESTED_WITH"] == "XMLHttpRequest" || $_GET["ajax"]);
+ return ($_SERVER["HTTP_X_REQUESTED_WITH"] == "XMLHttpRequest");
}
/** Send Location header and exit
if ($location == "") {
$location = ".";
}
- header("Location: $location" . (is_ajax() ? (strpos($location, "?") !== false ? "&" : "?") . "ajax=1" : ""));
+ header((is_ajax() ? "X-AJAX-Redirect" : "Location") . ": $location");
exit;
}
}
xmlhttp.onreadystatechange = function () {
if (xmlhttp.readyState == 4) {
var redirect = xmlhttp.getResponseHeader('X-AJAX-Redirect');
- if (redirect && history.replaceState) {
- history.replaceState(null, '', redirect);
+ if (redirect) {
+ if (history.replaceState) {
+ history.replaceState(null, '', redirect);
+ }
+ return ajaxSend(redirect);
}
var title = xmlhttp.getResponseHeader('X-AJAX-Title');
if (title) {