From: Jakub Vrana Date: Sat, 8 Mar 2025 22:12:08 +0000 (+0100) Subject: Extract variable X-Git-Tag: v5.0.2~3 X-Git-Url: https://git.joonet.de/?a=commitdiff_plain;h=4991817b0d9256cda6a4ef11214b77a6f5825b80;p=adminer.git Extract variable --- diff --git a/adminer/select.inc.php b/adminer/select.inc.php index e467fd2a..834a4b41 100644 --- a/adminer/select.inc.php +++ b/adminer/select.inc.php @@ -16,17 +16,18 @@ $order_columns = array(); // searchable columns $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"]; } @@ -348,13 +349,8 @@ if (!$columns && support("table")) { $desc = "&desc%5B0%5D=1"; $sortable = isset($field["privileges"]["order"]); echo "" . script("mixin(qsl('th'), {onmouseover: partial(columnMouse), onmouseout: partial(columnMouse, ' hidden')});", ""); - if ($sortable) { - echo ''; // $order[0] == $key - COUNT(*) - } - echo apply_sql_function($val["fun"], $name); //! columns looking like functions - if ($sortable) { - echo ""; - } + $fun = apply_sql_function($val["fun"], $name); //! columns looking like functions + echo ($sortable ? '' . "$fun" : $fun); // $order[0] == $key - COUNT(*) echo "