Save to history before session close
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1076 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
parent
464d84afd7
commit
9ef76665ab
|
@ -23,13 +23,13 @@ if (!$error && $_POST) {
|
||||||
$space = "(\\s|/\\*.*\\*/|(#|-- )[^\n]*\n|--\n)";
|
$space = "(\\s|/\\*.*\\*/|(#|-- )[^\n]*\n|--\n)";
|
||||||
$alter_database = "(CREATE|DROP)$space+(DATABASE|SCHEMA)\\b~isU";
|
$alter_database = "(CREATE|DROP)$space+(DATABASE|SCHEMA)\\b~isU";
|
||||||
$databases = &$_SESSION["databases"][$_GET["server"]];
|
$databases = &$_SESSION["databases"][$_GET["server"]];
|
||||||
|
if (!$fp && strlen($query) && (!$history || end($history) != $query)) { // don't add repeated
|
||||||
|
$history[] = $query;
|
||||||
|
}
|
||||||
if (isset($databases) && !preg_match("~\\b$alter_database", $query)) { // quick check - may be inside string
|
if (isset($databases) && !preg_match("~\\b$alter_database", $query)) { // quick check - may be inside string
|
||||||
//! false positive with $fp
|
//! false positive with $fp
|
||||||
session_write_close();
|
session_write_close();
|
||||||
}
|
}
|
||||||
if (!$fp && strlen($query) && (!$history || end($history) != $query)) { // don't add repeated
|
|
||||||
$history[] = $query;
|
|
||||||
}
|
|
||||||
$delimiter = ";";
|
$delimiter = ";";
|
||||||
$offset = 0;
|
$offset = 0;
|
||||||
$empty = true;
|
$empty = true;
|
||||||
|
@ -109,7 +109,7 @@ if (!$error && $_POST) {
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<form action="" method="post" enctype="multipart/form-data">
|
<form action="" method="post" enctype="multipart/form-data">
|
||||||
<p><textarea name="query" rows="20" cols="80" style="width: 98%;"><?php echo h($_POST ? $_POST["query"] : (strlen($_GET["history"]) ? $_SESSION["history"][$_GET["server"]][DB][$_GET["history"]] : $_GET["sql"])); ?></textarea>
|
<p><textarea name="query" rows="20" cols="80" style="width: 98%;"><?php echo h($_POST ? $_POST["query"] : (strlen($_GET["history"]) ? $history[$_GET["history"]] : $_GET["sql"])); ?></textarea>
|
||||||
<p>
|
<p>
|
||||||
<input type="hidden" name="token" value="<?php echo $token; ?>">
|
<input type="hidden" name="token" value="<?php echo $token; ?>">
|
||||||
<input type="submit" value="<?php echo lang('Execute'); ?>">
|
<input type="submit" value="<?php echo lang('Execute'); ?>">
|
||||||
|
|
Loading…
Reference in a new issue