Permalink
Browse files

Function nbsp

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1004 7c3ca157-0c34-0410-bff1-cbf682f78f5c
  • Loading branch information...
1 parent bcff025 commit c1969850044dd9629cc5b29217b6ef1513302332 jakubvrana committed Aug 25, 2009
Showing with 9 additions and 5 deletions.
  1. +1 −1 adminer/db.inc.php
  2. +5 −1 adminer/include/functions.inc.php
  3. +1 −1 adminer/processlist.inc.php
  4. +1 −1 adminer/table.inc.php
  5. +1 −1 adminer/variables.inc.php
View
@@ -60,7 +60,7 @@
$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>';
}
@@ -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;
@@ -20,7 +20,7 @@
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();
?>
View
@@ -14,7 +14,7 @@
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";
@@ -6,7 +6,7 @@
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";

0 comments on commit c196985

Please sign in to comment.