]> git.joonet.de Git - adminer.git/commitdiff
Function nbsp
authorjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Tue, 25 Aug 2009 10:26:47 +0000 (10:26 +0000)
committerjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Tue, 25 Aug 2009 10:26:47 +0000 (10:26 +0000)
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1004 7c3ca157-0c34-0410-bff1-cbf682f78f5c

adminer/db.inc.php
adminer/include/functions.inc.php
adminer/processlist.inc.php
adminer/table.inc.php
adminer/variables.inc.php

index 31b7a293c29c4aa9abd90a23d92a1f017b7e1ad9..1e361a983513dbbd223455539643dd8a4f156234 100644 (file)
@@ -60,7 +60,7 @@ if (!$table_status) {
                                $val = number_format($row[$key], 0, '.', lang(','));
                                echo '<td align="right">' . (strlen($row[$key]) ? '<a href="' . h(ME . "$link=") . urlencode($name) . '">' . str_replace(" ", "&nbsp;", ($key == "Rows" && $row["Engine"] == "InnoDB" && $val ? lang('~ %s', $val) : $val)) . '</a>' : '&nbsp;');
                        }
-                       echo "<td>" . (strlen(trim($row["Comment"])) ? h($row["Comment"]) : "&nbsp;");
+                       echo "<td>" . nbsp($row["Comment"]);
                } else {
                        echo '<td colspan="8"><a href="' . h(ME) . "select=" . urlencode($name) . '">' . lang('View') . '</a>';
                }
index 7bf84ca2d761c0c07c7276ef46a64879ef11d1ad..e8447b7589067683168e94439abcc79c07221927 100644 (file)
@@ -23,6 +23,10 @@ function h($string) {
        return htmlspecialchars($string, ENT_QUOTES);
 }
 
+function nbsp($string) {
+       return (strlen(trim($string)) ? h($string) : "&nbsp;");
+}
+
 function optionlist($options, $selected = null, $use_keys = false) {
        $return = "";
        foreach ($options as $k => $v) {
@@ -301,7 +305,7 @@ function input($field, $value, $function) {
                $functions = (isset($_GET["select"]) ? array("orig" => lang('original')) : array()) + $adminer->editFunctions($field);
                $first = array_search("", $functions) + (isset($_GET["select"]) ? 1 : 0);
                $onchange = ($first ? " onchange=\"var f = this.form['function[" . addcslashes($name, "\r\n'\\") . "]']; if ($first > f.selectedIndex) f.selectedIndex = $first;\"" : "");
-               echo (count($functions) > 1 ? "<select name='function[$name]'>" . optionlist($functions, $function) . "</select>" : (strlen($functions[0]) ? h($functions[0]) : "&nbsp;")) . '<td>';
+               echo (count($functions) > 1 ? "<select name='function[$name]'>" . optionlist($functions, $function) . "</select>" : nbsp($functions[0])) . '<td>';
                $input = $adminer->editInput($_GET["edit"], $field, " name='fields[$name]'$onchange", $value); // usage in call is without a table
                if (strlen($input)) {
                        echo $input;
index df800e9475f9e11c2f843ad7cea17436ca3ecff5..4118229fc1e5dc2320e25a18ae24adaa8cc1a511 100644 (file)
@@ -20,7 +20,7 @@ for ($i=0; $row = $result->fetch_assoc(); $i++) {
        if (!$i) {
                echo "<thead><tr lang='en'><th>&nbsp;<th>" . implode("<th>", array_keys($row)) . "</thead>\n";
        }
-       echo "<tr" . odd() . "><td><input type='checkbox' name='kill[]' value='$row[Id]'><td>" . implode("<td>", $row) . "\n";
+       echo "<tr" . odd() . "><td><input type='checkbox' name='kill[]' value='$row[Id]'><td>" . implode("<td>", array_map('nbsp', $row)) . "\n";
 }
 $result->free();
 ?>
index c5655058958ee7c5870ca8cfdc12c4ae9c6afe49..47c0c927defcf27656cae5679f17e6c7a7f004d8 100644 (file)
@@ -14,7 +14,7 @@ if ($result) {
        while ($row = $result->fetch_assoc()) {
                echo "<tr><th>" . h($row["Field"]);
                echo "<td>" . h($row["Type"]) . ($row["Null"] == "YES" ? " <i>NULL</i>" : "");
-               echo "<td>" . (strlen(trim($row["Comment"])) ? h($row["Comment"]) : "&nbsp;");
+               echo "<td>" . nbsp($row["Comment"]);
                echo "\n";
        }
        echo "</table>\n";
index eba9c04813e87aa60e70994509f53403af62be53..b1cdda0ff4b1e7b6bb1ff643d3c13dfe7da21857 100644 (file)
@@ -6,7 +6,7 @@ $result = $dbh->query("SHOW VARIABLES");
 while ($row = $result->fetch_assoc()) {
        echo "<tr>";
        echo "<th><code class='jush-sqlset'>" . h($row["Variable_name"]) . "</code>";
-       echo "<td>" . (strlen(trim($row["Value"])) ? h($row["Value"]) : "&nbsp;");
+       echo "<td>" . nbsp($row["Value"]);
 }
 $result->free();
 echo "</table>\n";