From: Jakub Vrana Date: Sat, 13 Sep 2014 18:00:00 +0000 (-0700) Subject: Fix displaying binary data X-Git-Tag: v4.2.0~44 X-Git-Url: https://git.joonet.de/?a=commitdiff_plain;h=51986426b766b69683fd1724379b86e5037a24a8;p=adminer.git Fix displaying binary data --- diff --git a/adminer/include/functions.inc.php b/adminer/include/functions.inc.php index 96d4713b..69b0ad16 100644 --- a/adminer/include/functions.inc.php +++ b/adminer/include/functions.inc.php @@ -1137,7 +1137,9 @@ function select_value($val, $link, $field, $text_length) { if ($return !== null) { if ($return === "") { // === - may be int $return = " "; - } elseif ($text_length != "" && is_shortable($field) && is_utf8($return)) { + } elseif (!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 } else { $return = h($return);