]> git.joonet.de Git - adminer.git/commitdiff
  is not needed with border-collapse
authorJakub Vrana <jakub@vrana.cz>
Tue, 20 Feb 2018 15:02:25 +0000 (16:02 +0100)
committerJakub Vrana <jakub@vrana.cz>
Tue, 20 Feb 2018 15:02:25 +0000 (16:02 +0100)
21 files changed:
adminer/db.inc.php
adminer/event.inc.php
adminer/include/adminer.inc.php
adminer/include/connect.inc.php
adminer/include/editing.inc.php
adminer/include/functions.inc.php
adminer/include/version.inc.php
adminer/indexes.inc.php
adminer/privileges.inc.php
adminer/processlist.inc.php
adminer/script.inc.php
adminer/static/functions.js
adminer/table.inc.php
adminer/user.inc.php
adminer/variables.inc.php
changes.txt
editor/include/adminer.inc.php
plugins/file-upload.php
plugins/table-structure.php
plugins/tinymce.php
plugins/wymeditor.php

index 6f3979775bdd03681357d1df88da970e8e526fb6..b3e71b951de9c6a06b321cf4ce252f79306d40f0 100644 (file)
@@ -104,18 +104,18 @@ if ($adminer->homepage()) {
                                                echo ($link ? "<td align='right'>" . (support("table") || $key == "Rows" || (support("indexes") && $key != "Data_length")
                                                        ? "<a href='" . h(ME . "$link[0]=") . urlencode($name) . "'$id title='$link[1]'>?</a>"
                                                        : "<span$id>?</span>"
-                                               ) : "<td id='$key-" . h($name) . "'>&nbsp;");
+                                               ) : "<td id='$key-" . h($name) . "'>");
                                        }
                                        $tables++;
                                }
-                               echo (support("comment") ? "<td id='Comment-" . h($name) . "'>&nbsp;" : "");
+                               echo (support("comment") ? "<td id='Comment-" . h($name) . "'>" : "");
                        }
 
-                       echo "<tr><td>&nbsp;<th>" . lang('%d in total', count($tables_list));
-                       echo "<td>" . nbsp($jush == "sql" ? $connection->result("SELECT @@storage_engine") : "");
-                       echo "<td>" . nbsp(db_collation(DB, collations()));
+                       echo "<tr><td><th>" . lang('%d in total', count($tables_list));
+                       echo "<td>" . h($jush == "sql" ? $connection->result("SELECT @@storage_engine") : "");
+                       echo "<td>" . h(db_collation(DB, collations()));
                        foreach (array("Data_length", "Index_length", "Data_free") as $key) {
-                               echo "<td align='right' id='sum-$key'>&nbsp;";
+                               echo "<td align='right' id='sum-$key'>";
                        }
 
                        echo "</table>\n";
@@ -159,7 +159,7 @@ if ($adminer->homepage()) {
                        $routines = routines();
                        if ($routines) {
                                echo "<table cellspacing='0'>\n";
-                               echo '<thead><tr><th>' . lang('Name') . '<td>' . lang('Type') . '<td>' . lang('Return type') . "<td>&nbsp;</thead>\n";
+                               echo '<thead><tr><th>' . lang('Name') . '<td>' . lang('Type') . '<td>' . lang('Return type') . "<td></thead>\n";
                                odd('');
                                foreach ($routines as $row) {
                                        $name = ($row["SPECIFIC_NAME"] == $row["ROUTINE_NAME"] ? "" : "&name=" . urlencode($row["ROUTINE_NAME"])); // not computed on the pages to be able to print the header first
index 92e4cb16e62f4f0a4e756824f6e340391d245dfc..91d07f12494a6bc03dc04905595ea9e616ac19e3 100644 (file)
@@ -42,7 +42,7 @@ if (!$row && $EVENT != "") {
 <tr><th><?php echo lang('Every'); ?><td><input type="number" name="INTERVAL_VALUE" value="<?php echo h($row["INTERVAL_VALUE"]); ?>" class="size"> <?php echo html_select("INTERVAL_FIELD", $intervals, $row["INTERVAL_FIELD"]); ?>
 <tr><th><?php echo lang('Status'); ?><td><?php echo html_select("STATUS", $statuses, $row["STATUS"]); ?>
 <tr><th><?php echo lang('Comment'); ?><td><input name="EVENT_COMMENT" value="<?php echo h($row["EVENT_COMMENT"]); ?>" maxlength="64">
-<tr><th>&nbsp;<td><?php echo checkbox("ON_COMPLETION", "PRESERVE", $row["ON_COMPLETION"] == "PRESERVE", lang('On completion preserve')); ?>
+<tr><th><td><?php echo checkbox("ON_COMPLETION", "PRESERVE", $row["ON_COMPLETION"] == "PRESERVE", lang('On completion preserve')); ?>
 </table>
 <p><?php textarea("EVENT_DEFINITION", $row["EVENT_DEFINITION"]); ?>
 <p>
index 68dad1e46afe2770a567a4c39294b079f8aacfce..cf003af9594895fa3eab10b332c595804c2f15c5 100644 (file)
@@ -312,7 +312,7 @@ class Adminer {
                        echo ($field["null"] ? " <i>NULL</i>" : "");
                        echo ($field["auto_increment"] ? " <i>" . lang('Auto Increment') . "</i>" : "");
                        echo (isset($field["default"]) ? " <span title='" . lang('Default value') . "'>[<b>" . h($field["default"]) . "</b>]</span>" : "");
-                       echo (support("comment") ? "<td>" . nbsp($field["comment"]) : "");
+                       echo (support("comment") ? "<td>" . h($field["comment"]) : "");
                        echo "\n";
                }
                echo "</table>\n";
index 0564878c69434e78290d7a256b45e3fe8d58336b..a3e188fa5dd6894071912af655721d1ccac188f7 100644 (file)
@@ -32,7 +32,7 @@ function connect_error() {
                        echo "<table cellspacing='0' class='checkable'>\n";
                        echo script("mixin(qsl('table'), {onclick: tableClick, ondblclick: partialArg(tableClick, true)});");
                        echo "<thead><tr>"
-                               . (support("database") ? "<td>&nbsp;" : "")
+                               . (support("database") ? "<td>" : "")
                                . "<th>" . lang('Database') . " - <a href='" . h(ME) . "refresh=1'>" . lang('Refresh') . "</a>"
                                . "<td>" . lang('Collation')
                                . "<td>" . lang('Tables')
@@ -47,7 +47,7 @@ function connect_error() {
                                $id = h("Db-" . $db);
                                echo "<tr" . odd() . ">" . (support("database") ? "<td>" . checkbox("db[]", $db, in_array($db, (array) $_POST["db"]), "", "", "", $id) : "");
                                echo "<th><a href='$root' id='$id'>" . h($db) . "</a>";
-                               $collation = nbsp(db_collation($db, $collations));
+                               $collation = h(db_collation($db, $collations));
                                echo "<td>" . (support("database") ? "<a href='$root" . ($scheme ? "&amp;ns=" : "") . "&amp;database=' title='" . lang('Alter database') . "'>$collation</a>" : $collation);
                                echo "<td align='right'><a href='$root&amp;schema=' id='tables-" . h($db) . "' title='" . lang('Database schema') . "'>" . ($_GET["dbsize"] ? $tables : "?") . "</a>";
                                echo "<td align='right' id='size-" . h($db) . "'>" . ($_GET["dbsize"] ? db_size($db) : "?");
index fef5e213cb5a802d50bce323005a4919497b4146..f3b741a17c67d42f913a24cd5bd6e04f3516ba47 100644 (file)
@@ -64,8 +64,6 @@ function select($result, $connection2 = null, $orgtables = array(), $limit = 0)
                                $val = "<i>NULL</i>";
                        } elseif ($blobs[$key] && !is_utf8($val)) {
                                $val = "<i>" . lang('%d byte(s)', strlen($val)) . "</i>"; //! link to download
-                       } elseif (!strlen($val)) { // strlen - SQLite can return int
-                               $val = "&nbsp;"; // some content to print a border
                        } else {
                                $val = h($val);
                                if ($types[$key] == 254) { // 254 - char
@@ -245,7 +243,7 @@ function edit_fields($fields, $collations, $type = "TABLE", $foreign_keys = arra
        $fields = array_values($fields);
        ?>
 <thead><tr>
-<?php if ($type == "PROCEDURE") { ?><td>&nbsp;<?php } ?>
+<?php if ($type == "PROCEDURE") { ?><td><?php } ?>
 <th id="label-name"><?php echo ($type == "TABLE" ? lang('Column name') : lang('Parameter name')); ?>
 <td id="label-type"><?php echo lang('Type'); ?><textarea id="enum-edit" rows="4" cols="12" wrap="off" style="display: none;"></textarea><?php echo script("qs('#enum-edit').onblur = editingLengthBlur;"); ?>
 <td id="label-length"><?php echo lang('Length'); ?>
@@ -285,9 +283,9 @@ function edit_fields($fields, $collations, $type = "TABLE", $foreign_keys = arra
                }
                echo "<td>";
                echo (support("move_col") ?
-                       "<input type='image' class='icon' name='add[$i]' src='../adminer/static/plus.gif' alt='+' title='" . lang('Add next') . "'>&nbsp;"
-                       . "<input type='image' class='icon' name='up[$i]' src='../adminer/static/up.gif' alt='↑' title='" . lang('Move up') . "'>&nbsp;"
-                       . "<input type='image' class='icon' name='down[$i]' src='../adminer/static/down.gif' alt='↓' title='" . lang('Move down') . "'>&nbsp;"
+                       "<input type='image' class='icon' name='add[$i]' src='../adminer/static/plus.gif' alt='+' title='" . lang('Add next') . "'> "
+                       . "<input type='image' class='icon' name='up[$i]' src='../adminer/static/up.gif' alt='↑' title='" . lang('Move up') . "'> "
+                       . "<input type='image' class='icon' name='down[$i]' src='../adminer/static/down.gif' alt='↓' title='" . lang('Move down') . "'> "
                : "");
                echo ($orig == "" || support("drop_col") ? "<input type='image' class='icon' name='drop_col[$i]' src='../adminer/static/cross.gif' alt='x' title='" . lang('Remove') . "'>" : "");
        }
index 0dc638d82e051ebc384df94674a301bdab9e8b36..a9d8b9316e4b2e35974c0b5169f91a5eb2a75297 100644 (file)
@@ -154,14 +154,6 @@ function h($string) {
        return str_replace("\0", "&#0;", htmlspecialchars($string, ENT_QUOTES, 'utf-8'));
 }
 
-/** Escape for TD
-* @param string
-* @return string
-*/
-function nbsp($string) {
-       return (trim($string) != "" ? h($string) : "&nbsp;");
-}
-
 /** Convert \n to <br>
 * @param string
 * @return string
@@ -946,14 +938,14 @@ function input($field, $value, $function) {
        $functions = (isset($_GET["select"]) || $reset ? array("orig" => lang('original')) : array()) + $adminer->editFunctions($field);
        $attrs = " name='fields[$name]'";
        if ($field["type"] == "enum") {
-               echo nbsp($functions[""]) . "<td>" . $adminer->editInput($_GET["edit"], $field, $attrs, $value);
+               echo h($functions[""]) . "<td>" . $adminer->editInput($_GET["edit"], $field, $attrs, $value);
        } else {
                $has_function = (in_array($function, $functions) || isset($functions[$function]));
                echo (count($functions) > 1
                        ? "<select name='function[$name]'>" . optionlist($functions, $function === null || $has_function ? $function : "") . "</select>"
                                . on_help("getTarget(event).value.replace(/^SQL\$/, '')", 1)
                                . script("qsl('select').onchange = functionChange;", "")
-                       : nbsp(reset($functions))
+                       : h(reset($functions))
                ) . '<td>';
                $input = $adminer->editInput($_GET["edit"], $field, $attrs, $value); // usage in call is without a table
                if ($input != "") {
@@ -1253,9 +1245,7 @@ function select_value($val, $link, $field, $text_length) {
        }
        $return = $adminer->editVal($val, $field);
        if ($return !== null) {
-               if ($return === "") { // === - may be int
-                       $return = "&nbsp;";
-               } elseif (!is_utf8($return)) {
+               if (!is_utf8($return)) {
                        $return = "\0"; // htmlspecialchars of binary data returns an empty string
                } elseif ($text_length != "" && is_shortable($field)) {
                        $return = shorten_utf8($return, max(0, +$text_length)); // usage of LEFT() would reduce traffic but complicate query - expected average speedup: .001 s VS .01 s on local network
index 69105a13e7049b13d4a7733009bc2ceb97c0b3fe..59ff893c0c57908f6967536a3e949c2926de915d 100644 (file)
@@ -1,2 +1,2 @@
 <?php
-$VERSION = "4.6.2";
+$VERSION = "4.6.3-dev";
index 222287a13304d878dd80ff454b5c91202954288d..7c44f7bdaf99a2c02f546f1e665a4d589b5dbb79 100644 (file)
@@ -99,7 +99,7 @@ if (!$row) {
 <th id="label-type"><?php echo lang('Index Type'); ?>
 <th><input type="submit" class="wayoff"><?php echo lang('Column (length)'); ?>
 <th id="label-name"><?php echo lang('Name'); ?>
-<th><noscript><input type='image' class='icon' name='add[0]' src='../adminer/static/plus.gif' alt='+' title='<?php echo lang('Add next'); ?>'></noscript>&nbsp;
+<th><noscript><input type='image' class='icon' name='add[0]' src='../adminer/static/plus.gif' alt='+' title='<?php echo lang('Add next'); ?>'></noscript>
 </thead>
 <?php
 if ($primary) {
index d071461f129a73674f479a00e5dbaa36be082412..6e1e31aa40369a1587e35892eeabc1b35dcb8c1b 100644 (file)
@@ -15,7 +15,7 @@ hidden_fields_get();
 echo "<input type='hidden' name='db' value='" . h(DB) . "'>\n";
 echo ($grant ? "" : "<input type='hidden' name='grant' value=''>\n");
 echo "<table cellspacing='0'>\n";
-echo "<thead><tr><th>" . lang('Username') . "<th>" . lang('Server') . "<th>&nbsp;</thead>\n";
+echo "<thead><tr><th>" . lang('Username') . "<th>" . lang('Server') . "<th></thead>\n";
 
 while ($row = $result->fetch_assoc()) {
        echo '<tr' . odd() . '><td>' . h($row["User"]) . "<td>" . h($row["Host"]) . '<td><a href="' . h(ME . 'user=' . urlencode($row["User"]) . '&host=' . urlencode($row["Host"])) . '">' . lang('Edit') . "</a>\n";
index dd39268be062b63e981810a49a844fc785432369..00a79714fc136f6040bb490a02ffdbb63f216e91 100644 (file)
@@ -21,7 +21,7 @@ $i = -1;
 foreach (process_list() as $i => $row) {
 
        if (!$i) {
-               echo "<thead><tr lang='en'>" . (support("kill") ? "<th>&nbsp;" : "");
+               echo "<thead><tr lang='en'>" . (support("kill") ? "<th>" : "");
                foreach ($row as $key => $val) {
                        echo "<th>$key" . doc_link(array(
                                'sql' => "show-processlist.html#processlist_" . strtolower($key),
@@ -38,7 +38,7 @@ foreach (process_list() as $i => $row) {
                        ($jush == "pgsql" && $key == "current_query" && $val != "<IDLE>") ||
                        ($jush == "oracle" && $key == "sql_text" && $val != "")
                        ? "<code class='jush-$jush'>" . shorten_utf8($val, 100, "</code>") . ' <a href="' . h(ME . ($row["db"] != "" ? "db=" . urlencode($row["db"]) . "&" : "") . "sql=" . urlencode($val)) . '">' . lang('Clone') . '</a>'
-                       : nbsp($val)
+                       : h($val)
                );
        }
        echo "\n";
index d36f03df1b7a9ef213686f4c4bcfebdba04011cd..f5461bc288031b531beac872e44af20e83cb9bd5 100644 (file)
@@ -4,10 +4,10 @@ header("Content-Type: text/javascript; charset=utf-8");
 if ($_GET["script"] == "db") {
        $sums = array("Data_length" => 0, "Index_length" => 0, "Data_free" => 0);
        foreach (table_status() as $name => $table_status) {
-               json_row("Comment-$name", nbsp($table_status["Comment"]));
+               json_row("Comment-$name", h($table_status["Comment"]));
                if (!is_view($table_status)) {
                        foreach (array("Engine", "Collation") as $key) {
-                               json_row("$key-$name", nbsp($table_status[$key]));
+                               json_row("$key-$name", h($table_status[$key]));
                        }
                        foreach ($sums + array("Auto_increment" => 0, "Rows" => 0) as $key => $val) {
                                if ($table_status[$key] != "") {
index 907b37f2e7492cbb014cad9a20af4fd66320bb0f..75115923caf4404728dc642867d836568adc5cb2 100644 (file)
@@ -319,13 +319,13 @@ function checkboxClick(event) {
 
 /** Set HTML code of an element
 * @param string
-* @param string undefined to set parentNode to &nbsp;
+* @param string undefined to set parentNode to empty string
 */
 function setHtml(id, html) {
        var el = qs('#' + id);
        if (el) {
                if (html == null) {
-                       el.parentNode.innerHTML = '&nbsp;';
+                       el.parentNode.innerHTML = '';
                } else {
                        el.innerHTML = html;
                }
@@ -716,7 +716,7 @@ function selectClick(event, text, warning) {
                });
                input.rows = rows;
        }
-       if (value == '\u00A0' || qsa('i', td).length) { // &nbsp; or i - NULL
+       if (qsa('i', td).length) { // <i> - NULL
                value = '';
        }
        if (document.selection) {
index 86d20695760a4354a0d5d1cbfcb6934c56ad8141..6c63f97094396351ffff877b9c464deefbcf1ab0 100644 (file)
@@ -34,7 +34,7 @@ if (!is_view($table_status)) {
                $foreign_keys = foreign_keys($TABLE);
                if ($foreign_keys) {
                        echo "<table cellspacing='0'>\n";
-                       echo "<thead><tr><th>" . lang('Source') . "<td>" . lang('Target') . "<td>" . lang('ON DELETE') . "<td>" . lang('ON UPDATE') . "<td>&nbsp;</thead>\n";
+                       echo "<thead><tr><th>" . lang('Source') . "<td>" . lang('Target') . "<td>" . lang('ON DELETE') . "<td>" . lang('ON UPDATE') . "<td></thead>\n";
                        foreach ($foreign_keys as $name => $foreign_key) {
                                echo "<tr title='" . h($name) . "'>";
                                echo "<th><i>" . implode("</i>, <i>", array_map('h', $foreign_key["source"])) . "</i>";
@@ -43,8 +43,8 @@ if (!is_view($table_status)) {
                                        . "</a>"
                                ;
                                echo "(<i>" . implode("</i>, <i>", array_map('h', $foreign_key["target"])) . "</i>)";
-                               echo "<td>" . nbsp($foreign_key["on_delete"]) . "\n";
-                               echo "<td>" . nbsp($foreign_key["on_update"]) . "\n";
+                               echo "<td>" . h($foreign_key["on_delete"]) . "\n";
+                               echo "<td>" . h($foreign_key["on_update"]) . "\n";
                                echo '<td><a href="' . h(ME . 'foreign=' . urlencode($TABLE) . '&name=' . urlencode($name)) . '">' . lang('Alter') . '</a>';
                        }
                        echo "</table>\n";
index abaab55a9704d764799ef7d6cf21d7ff571fdc71..b000165f0b422a55c9f8d8bac50f55df10c2ca8a 100644 (file)
@@ -165,7 +165,7 @@ foreach (array(
                        $name = "'grants[$i][" . h(strtoupper($privilege)) . "]'";
                        $value = $grant[strtoupper($privilege)];
                        if ($context == "Server Admin" && $object != (isset($grants["*.*"]) ? "*.*" : ".*")) {
-                               echo "<td>&nbsp;";
+                               echo "<td>";
                        } elseif (isset($_GET["grant"])) {
                                echo "<td><select name=$name><option><option value='1'" . ($value ? " selected" : "") . ">" . lang('Grant') . "<option value='0'" . ($value == "0" ? " selected" : "") . ">" . lang('Revoke') . "</select>";
                        } else {
index 901109e0c173df534e47e075e6b977c4e30f997e..3976440de2ddfa3c9035ab9ed7173490f4f9ded2 100644 (file)
@@ -10,7 +10,7 @@ if (!$variables) {
        foreach ($variables as $key => $val) {
                echo "<tr>";
                echo "<th><code class='jush-" . $jush . ($status ? "status" : "set") . "'>" . h($key) . "</code>";
-               echo "<td>" . nbsp($val);
+               echo "<td>" . h($val);
        }
        echo "</table>\n";
 }
index 38d6f50db4420a2840817200bcf6e09ae2e22db0..a2e812fa30b1e78db68d1a3cb9992105fd4ace4c 100644 (file)
@@ -1,3 +1,5 @@
+Adminer 4.6.3-dev:
+
 Adminer 4.6.2 (released 2018-02-20):
 Semi-transparent border on table actions
 Shorten JSON values in select (bug #594)
index ea4680a53f8a1aae430d807c7e5a0279f622be84..70b5b1a32d261fa57effcf0c956e5c58d17cad81 100644 (file)
@@ -189,7 +189,7 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5
        }
 
        function selectVal($val, $link, $field, $original) {
-               $return = ($val === null ? "&nbsp;" : $val);
+               $return = $val;
                $link = h($link);
                if (preg_match('~blob|bytea~', $field["type"]) && !is_utf8($val)) {
                        $return = lang('%d byte(s)', strlen($original));
@@ -197,7 +197,7 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5
                                $return = "<img src='$link' alt='$return'>";
                        }
                }
-               if (like_bool($field) && $return != "&nbsp;") { // bool
+               if (like_bool($field) && $return != "") { // bool
                        $return = (preg_match('~^(1|t|true|y|yes|on)$~i', $val) ? lang('yes') : lang('no'));
                }
                if ($link) {
index 806fd593f7c6176653ce3e3826d39c824e23197f..af352673139106103d07b15f3ea0581ad0f4eb00 100644 (file)
@@ -45,7 +45,7 @@ class AdminerFileUpload {
        }
 
        function selectVal($val, &$link, $field, $original) {
-               if ($val != "&nbsp;" && preg_match('~(.*)_path$~', $field["field"], $regs)) {
+               if ($val != "" && preg_match('~(.*)_path$~', $field["field"], $regs)) {
                        $link = "$this->displayPath$_GET[select]/$regs[1]-$val";
                }
        }
index 09d7a6e51e1c72f6a2e0da3e02279887b799001a..cd639b59075f72260d177a64eab00ce8290cace4 100644 (file)
@@ -21,8 +21,8 @@ class AdminerTableStructure {
                        echo ($field["auto_increment"] ? " <i>" . lang('Auto Increment') . "</i>" : "");
                        echo ($field["collation"] ? " <i>" . h($field["collation"]) . "</i>" : "");
                        echo "<td>" . ($field["null"] ? lang('Yes') : lang('No'));
-                       echo "<td>" . (isset($field["default"]) ? h($field["default"]) : "&nbsp;");
-                       echo (support("comment") ? "<td>" . nbsp($field["comment"]) : "");
+                       echo "<td>" . h($field["default"]);
+                       echo (support("comment") ? "<td>" . h($field["comment"]) : "");
                        echo "\n";
                }
                echo "</table>\n";
index 5c4d32bc8c5596c2d88261f6ee684b8dc5a27a71..f5f169c8bb16fcdf50f1e4842f67bd0c2169befd 100644 (file)
@@ -39,7 +39,7 @@ tinyMCE.init({
        }
 
        function selectVal(&$val, $link, $field, $original) {
-               if (preg_match("~_html~", $field["field"]) && $val != '&nbsp;') {
+               if (preg_match("~_html~", $field["field"]) && $val != '') {
                        $shortened = (substr($val, -10) == "<i>...</i>");
                        if ($shortened) {
                                $val = substr($val, 0, -10);
index 36c07564378b4e63d712ca7dccf1dd1391244c17..083a254c67f4100066fe6a2355540f4b15627d7f 100644 (file)
@@ -28,7 +28,7 @@ class AdminerWymeditor {
 
        function selectVal(&$val, $link, $field, $original) {
                // copied from tinymce.php
-               if (preg_match("~_html~", $field["field"]) && $val != '&nbsp;') {
+               if (preg_match("~_html~", $field["field"]) && $val != '') {
                        $shortened = (substr($val, -10) == "<i>...</i>");
                        if ($shortened) {
                                $val = substr($val, 0, -10);