$text_length = null;
foreach ($fields as $key => $field) {
$name = $adminer->fieldName($field);
+ $name_plain = html_entity_decode(strip_tags($name), ENT_QUOTES);
if (isset($field["privileges"]["select"]) && $name != "") {
- $columns[$key] = html_entity_decode(strip_tags($name), ENT_QUOTES);
+ $columns[$key] = $name_plain;
if (is_shortable($field)) {
$text_length = $adminer->selectLengthProcess();
}
}
if (isset($field["privileges"]["where"]) && $name != "") {
- $search_columns[$key] = html_entity_decode(strip_tags($name), ENT_QUOTES);
+ $search_columns[$key] = $name_plain;
}
if (isset($field["privileges"]["order"]) && $name != "") {
- $order_columns[$key] = html_entity_decode(strip_tags($name), ENT_QUOTES);
+ $order_columns[$key] = $name_plain;
}
$rights += $field["privileges"];
}
$desc = "&desc%5B0%5D=1";
$sortable = isset($field["privileges"]["order"]);
echo "<th id='th[" . h(bracket_escape($key)) . "]'>" . script("mixin(qsl('th'), {onmouseover: partial(columnMouse), onmouseout: partial(columnMouse, ' hidden')});", "");
- if ($sortable) {
- echo '<a href="' . h($href . ($order[0] == $column || $order[0] == $key || (!$order && $is_group && $group[0] == $column) ? $desc : '')) . '">'; // $order[0] == $key - COUNT(*)
- }
- echo apply_sql_function($val["fun"], $name); //! columns looking like functions
- if ($sortable) {
- echo "</a>";
- }
+ $fun = apply_sql_function($val["fun"], $name); //! columns looking like functions
+ echo ($sortable ? '<a href="' . h($href . ($order[0] == $column || $order[0] == $key || (!$order && $is_group && $group[0] == $column) ? $desc : '')) . '">' . "$fun</a>" : $fun); // $order[0] == $key - COUNT(*)
echo "<span class='column hidden'>";
if ($sortable) {
echo "<a href='" . h($href . $desc) . "' title='" . lang('descending') . "' class='text'> ↓</a>";