diff --git a/adminer/include/design.inc.php b/adminer/include/design.inc.php
index c347271e..a74b6913 100644
--- a/adminer/include/design.inc.php
+++ b/adminer/include/design.inc.php
@@ -64,7 +64,7 @@ function page_header($title, $error = "", $breadcrumb = array(), $title2 = "") {
}
echo "
$title_all
\n";
restart_session();
- $uri = preg_replace('~^[^?]*/~', '', $_SERVER["REQUEST_URI"]);
+ $uri = preg_replace('~^[^?]*~', '', $_SERVER["REQUEST_URI"]);
$messages = $_SESSION["messages"][$uri];
if ($messages) {
echo "" . implode("
\n", $messages) . "
\n";
diff --git a/adminer/include/editing.inc.php b/adminer/include/editing.inc.php
index 7ec5dbb6..44958a83 100644
--- a/adminer/include/editing.inc.php
+++ b/adminer/include/editing.inc.php
@@ -348,8 +348,7 @@ function drop_create($drop, $create, $location, $message_drop, $message_alter, $
$dropped = $name != "" && ($_POST["dropped"] || queries($drop));
$created = queries($create);
if (!queries_redirect($location, ($name != "" ? $message_alter : $message_create), $created) && $dropped) {
- restart_session();
- $_SESSION["messages"][preg_replace('~^[^?]*/~', '', $_SERVER["REQUEST_URI"])][] = $message_drop;
+ redirect(null, $message_drop);
}
return $dropped;
}
diff --git a/adminer/include/functions.inc.php b/adminer/include/functions.inc.php
index 54d504ef..75795c73 100644
--- a/adminer/include/functions.inc.php
+++ b/adminer/include/functions.inc.php
@@ -384,7 +384,7 @@ function is_ajax() {
function redirect($location, $message = null) {
if (isset($message)) {
restart_session();
- $_SESSION["messages"][preg_replace('~^[^?]*/~', '', $location)][] = $message;
+ $_SESSION["messages"][preg_replace('~^[^?]*~', '', (isset($location) ? $location : $_SERVER["REQUEST_URI"]))][] = $message;
}
if (isset($location)) {
if ($location == "") {