mirror of
https://github.com/vrana/adminer.git
synced 2026-07-30 06:40:09 +02:00
Greedy expressions
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@105 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
@@ -2,12 +2,12 @@
|
||||
if ($_POST && !$error) {
|
||||
if ($_POST["drop"]) {
|
||||
if ($mysql->query("DROP DATABASE " . idf_escape($_GET["db"]))) {
|
||||
redirect(substr(preg_replace('~(\\?)db=[^&]*&|&db=[^&]*~', '\\1', $SELF), 0, -1), lang('Database has been dropped.'));
|
||||
redirect(substr(preg_replace('~db=[^&]*&~', '', $SELF), 0, -1), lang('Database has been dropped.'));
|
||||
}
|
||||
} elseif ($_GET["db"] !== $_POST["name"]) {
|
||||
if ($mysql->query("CREATE DATABASE " . idf_escape($_POST["name"]) . ($_POST["collation"] ? " COLLATE '" . $mysql->escape_string($_POST["collation"]) . "'" : ""))) {
|
||||
if (!strlen($_GET["db"])) {
|
||||
redirect(preg_replace('~(\\?)db=[^&]*&|&db=[^&]*~', '\\1', $SELF) . "db=" . urlencode($_POST["name"]), lang('Database has been created.'));
|
||||
redirect(preg_replace('~db=[^&]*&~', '', $SELF) . "db=" . urlencode($_POST["name"]), lang('Database has been created.'));
|
||||
}
|
||||
$result = $mysql->query("SHOW TABLES");
|
||||
while ($row = $result->fetch_row()) {
|
||||
@@ -18,7 +18,7 @@ if ($_POST && !$error) {
|
||||
$result->free();
|
||||
if (!$row) {
|
||||
$mysql->query("DROP DATABASE " . idf_escape($_GET["db"]));
|
||||
redirect(preg_replace('~(\\?)db=[^&]*&|&db=[^&]*~', '\\1', $SELF) . "db=" . urlencode($_POST["name"]), lang('Database has been renamed.'));
|
||||
redirect(preg_replace('~db=[^&]*&~', '', $SELF) . "db=" . urlencode($_POST["name"]), lang('Database has been renamed.'));
|
||||
}
|
||||
}
|
||||
} elseif (!$_POST["collation"] || $mysql->query("ALTER DATABASE " . idf_escape($_POST["name"]) . " COLLATE '" . $mysql->escape_string($_POST["collation"]) . "'")) {
|
||||
|
||||
Reference in New Issue
Block a user