PostgreSQL: Don't treat user types containing 'file' as blobs (fix #1118)

This commit is contained in:
Jakub Vrana
2025-09-07 13:44:00 +02:00
parent 2db30ba7e2
commit fc2ab7de16
6 changed files with 15 additions and 7 deletions

View File

@@ -219,7 +219,7 @@ ORDER BY ORDINAL_POSITION", null, "") as $row
function selectVal($val, $link, $field, $original) {
$return = $val;
$link = h($link);
if (preg_match('~blob|bytea~', $field["type"]) && !is_utf8($val)) {
if (is_blob($field) && !is_utf8($val)) {
$return = lang('%d byte(s)', strlen($original));
if (preg_match("~^(GIF|\xFF\xD8\xFF|\x89PNG\x0D\x0A\x1A\x0A)~", $original)) { // GIF|JPG|PNG, getimagetype() works with filename
$return = "<img src='$link' alt='$return'>";