diff --git a/adminer/include/adminer.inc.php b/adminer/include/adminer.inc.php
index 2cb57194..8a0f8e1e 100644
--- a/adminer/include/adminer.inc.php
+++ b/adminer/include/adminer.inc.php
@@ -109,10 +109,12 @@ function adminer_row_descriptions($rows, $foreign_keys) {
/** Value printed in select table
* @param string escaped value to print
* @param string link to foreign key
+* @param array single field returned from fields()
* @return string
*/
-function adminer_select_val($val, $link) {
- return call_adminer('select_val', ($link ? "$val" : $val), $val, $link);
+function adminer_select_val($val, $link, $field) {
+ $return = ($field["type"] == "char" ? "$val
" : $val);
+ return call_adminer('select_val', ($link ? "$return" : $return), $val, $link);
}
/** Query printed after execution in the message
diff --git a/adminer/include/functions.inc.php b/adminer/include/functions.inc.php
index 3dd64e16..0f6d4dab 100644
--- a/adminer/include/functions.inc.php
+++ b/adminer/include/functions.inc.php
@@ -364,11 +364,11 @@ function email_header($header) {
return "=?UTF-8?B?" . base64_encode($header) . "?="; //! split long lines
}
-function call_adminer($method, $default, $arg1 = null, $arg2 = null) {
+function call_adminer($method, $default, $arg1 = null, $arg2 = null, $arg3 = null) {
// maintains original method name in minification
if (method_exists('Adminer', $method)) { // user defined class
// can use func_get_args() and call_user_func_array()
- return Adminer::$method($arg1, $arg2);
+ return Adminer::$method($arg1, $arg2, $arg3);
}
return $default; //! $default is evaluated even if not neccessary
}
diff --git a/adminer/select.inc.php b/adminer/select.inc.php
index d4622e58..22025738 100644
--- a/adminer/select.inc.php
+++ b/adminer/select.inc.php
@@ -312,7 +312,7 @@ if (!$columns) {
$unique_idf = implode('&', unique_idf($rows[$n], $indexes)); //! don't use aggregation functions
echo '
$val
";
- }
}
// link related items
@@ -348,7 +345,7 @@ if (!$columns) {
if (!$link && is_email($val)) {
$link = "mailto:$val";
}
- $val = adminer_select_val($val, $link);
+ $val = adminer_select_val($val, $link, $fields[$key]);
echo "(.*)
$~', '\\1', $val))
+function adminer_select_val($val, $link, $field) {
+ return call_adminer('select_val', ($link
+ ? "$val"
+ : ($val == "NULL" ? " " : $val)
), $val, $link);
}