Skip to content

Commit

Permalink
Display char type in <code>
Browse files Browse the repository at this point in the history
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@178 7c3ca157-0c34-0410-bff1-cbf682f78f5c
  • Loading branch information
jakubvrana committed Jul 15, 2007
1 parent fe7d84a commit ae6892d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions functions.inc.php
Expand Up @@ -212,6 +212,7 @@ function select($result) {
$indexes = array();
$columns = array();
$blobs = array();
$types = array();
for ($j=0; $j < count($row); $j++) {
$field = $result->fetch_field();
if (strlen($field->orgtable) && $field->flags & 2) {
Expand All @@ -234,6 +235,7 @@ function select($result) {
if ($field->charsetnr == 63) {
$blobs[$j] = true;
}
$types[$j] = $field->type;
echo "<th>" . htmlspecialchars($field->name) . "</th>";
}
echo "</tr></thead>\n";
Expand All @@ -247,6 +249,9 @@ function select($result) {
$val = "<i>" . lang('%d byte(s)', strlen($val)) . "</i>";
} else {
$val = (strlen(trim($val)) ? nl2br(htmlspecialchars($val)) : "&nbsp;");
if ($types[$key] == 254) {
$val = "<code>$val</code>";
}
}
if (isset($links[$key]) && !$columns[$links[$key]]) {
$link = "edit=" . urlencode($links[$key]);
Expand Down
3 changes: 3 additions & 0 deletions select.inc.php
Expand Up @@ -147,6 +147,9 @@ function where_change(op) {
$val = '<a href="' . htmlspecialchars($SELF) . 'download=' . urlencode($_GET["select"]) . '&amp;field=' . urlencode($key) . $unique_idf . '">' . lang('%d byte(s)', strlen($val)) . '</a>';
} else {
$val = (strlen(trim($val)) ? nl2br(htmlspecialchars($val)) : "&nbsp;");
if ($fields[$key]["type"] == "char") {
$val = "<code>$val</code>";
}
foreach ((array) $foreign_keys[$key] as $foreign_key) {
if (count($foreign_keys[$key]) == 1 || count($foreign_key["source"]) == 1) {
$val = '">' . "$val</a>";
Expand Down

0 comments on commit ae6892d

Please sign in to comment.