]> git.joonet.de Git - adminer.git/commitdiff
Fix cookie name if the DB name contains dot
authorJakub Vrana <jakub@vrana.cz>
Mon, 21 Apr 2014 16:59:52 +0000 (09:59 -0700)
committerJakub Vrana <jakub@vrana.cz>
Mon, 21 Apr 2014 16:59:52 +0000 (09:59 -0700)
adminer/schema.inc.php

index a70cc1ad41ec6f229a31b3c88fbac0ab5e342ff7..1bc7241ab87023bc79fd8072a12b36823a482c03 100644 (file)
@@ -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]);