mirror of
https://github.com/vrana/adminer.git
synced 2025-08-11 17:14:07 +02:00
Fix XSS in displaying non-UTF-8 strings
This commit is contained in:
@@ -349,12 +349,10 @@ if (!$columns) {
|
||||
}
|
||||
if ($val === "") { // === - may be int
|
||||
$val = " ";
|
||||
} elseif (is_utf8($val)) {
|
||||
if ($text_length != "" && is_shortable($field)) {
|
||||
$val = shorten_utf8($val, 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 {
|
||||
$val = h($val);
|
||||
}
|
||||
} elseif ($text_length != "" && is_shortable($field)) {
|
||||
$val = shorten_utf8($val, 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 {
|
||||
$val = h($val);
|
||||
}
|
||||
|
||||
if (!$link) { // link related items
|
||||
|
Reference in New Issue
Block a user