Permalink
Browse files

Save bytes

  • Loading branch information...
vrana committed Jun 4, 2011
1 parent 955e6b4 commit 8372913ab5331eea700d78c6737f53b3dd7b4d7d
Showing with 3 additions and 3 deletions.
  1. +1 −1 adminer/include/adminer.inc.php
  2. +1 −1 adminer/privileges.inc.php
  3. +1 −1 adminer/user.inc.php
@@ -433,7 +433,7 @@ function messageQuery($query) {
if (strlen($query) > 1e6) { // not DB - reset in drop database
$query = ereg_replace('[\x80-\xFF]+$', '', substr($query, 0, 1e6)) . "\n..."; // [\x80-\xFF] - valid UTF-8, \n - can end by one-line comment
}
- $history[$_GET["db"]][] = $query; //! respect $_GET["ns"]
+ $history[$_GET["db"]][] = $query; // not DB - $_GET["db"] is changed in database.inc.php //! respect $_GET["ns"]
return " <a href='#$id' onclick=\"return !toggle('$id');\">" . lang('SQL command') . "</a><div id='$id' class='hidden'><pre><code class='jush-$jush'>" . shorten_utf8($query, 1000) . '</code></pre><p><a href="' . h(str_replace("db=" . urlencode(DB), "db=" . urlencode($_GET["db"]), ME) . 'sql=&history=' . (count($history[$_GET["db"]]) - 1)) . '">' . lang('Edit') . '</a></div>';
}
@@ -1,7 +1,7 @@
<?php
page_header(lang('Privileges'));
-$result = $connection->query("SELECT User, Host FROM mysql." . ($_GET["db"] == "" ? "user" : "db WHERE " . q($_GET["db"]) . " LIKE Db") . " ORDER BY Host, User");
+$result = $connection->query("SELECT User, Host FROM mysql." . (DB == "" ? "user" : "db WHERE " . q($_GET["db"]) . " LIKE Db") . " ORDER BY Host, User");
if (!$result) {
?>
<form action=""><p>
View
@@ -111,7 +111,7 @@
if ($old_pass != "") {
$row["hashed"] = true;
}
- $grants[$_GET["db"] != "" && $_GET["user"] == "" ? idf_escape($_GET["db"]) . ".*" : ""] = array();
+ $grants[DB != "" && !isset($_GET["host"]) ? idf_escape($_GET["db"]) . ".*" : ""] = array();
}
?>

0 comments on commit 8372913

Please sign in to comment.