From 03e31ed154646212f9ab976e497829cc0afc1cde Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Mon, 21 Apr 2014 09:59:52 -0700 Subject: [PATCH] Fix cookie name if the DB name contains dot --- adminer/schema.inc.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/adminer/schema.inc.php b/adminer/schema.inc.php index a70cc1ad..1bc7241a 100644 --- a/adminer/schema.inc.php +++ b/adminer/schema.inc.php @@ -3,8 +3,7 @@ page_header(lang('Database schema'), "", array(), h(DB . ($_GET["ns"] ? ".$_GET[ $table_pos = array(); $table_pos_js = array(); -$name = "adminer_schema"; -$SCHEMA = ($_GET["schema"] ? $_GET["schema"] : $_COOKIE[($_COOKIE["$name-" . DB] ? "$name-" . DB : $name)]); // $_COOKIE["adminer_schema"] was used before 3.2.0 //! ':' in table name +$SCHEMA = ($_GET["schema"] ? $_GET["schema"] : $_COOKIE["adminer_schema-" . str_replace(".", "_", DB)]); // $_COOKIE["adminer_schema"] was used before 3.2.0 //! ':' in table name preg_match_all('~([^:]+):([-0-9.]+)x([-0-9.]+)(_|$)~', $SCHEMA, $matches, PREG_SET_ORDER); foreach ($matches as $i => $match) { $table_pos[$match[1]] = array($match[2], $match[3]);