Save bytes

This commit is contained in:
Jakub Vrana 2011-06-04 04:28:17 +02:00
parent 955e6b44b3
commit 8372913ab5
3 changed files with 3 additions and 3 deletions

View file

@ -433,7 +433,7 @@ username.form['driver'].onchange();
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>';
}

View file

@ -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 file

@ -111,7 +111,7 @@ if ($_POST) {
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();
}
?>