mirror of
https://github.com/vrana/adminer.git
synced 2025-08-06 14:46:36 +02:00
Align money values right (bug #1071)
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
- Autocomplete: Support table aliases
|
||||
- Fix type error in Create function (bug #1053, regression from 5.1.1)
|
||||
- Add border to column actions (bug #1072)
|
||||
- Align money values right (bug #1071)
|
||||
- MySQL: Avoid warning on selecting tables with fulltext indexes (bug #1036)
|
||||
- MySQL, PostgreSQL: Support index algorithms (bug #1030)
|
||||
- MySQL: Fix connecting to localhost:3306 (bug #1057, regression from 5.1.1)
|
||||
|
@@ -460,12 +460,10 @@ if (!$columns && support("table")) {
|
||||
$id = h("val[$unique_idf][" . bracket_escape($key) . "]");
|
||||
$posted = idx(idx($_POST["val"], $unique_idf), bracket_escape($key));
|
||||
$editable = !is_array($row[$key]) && is_utf8($html) && $rows[$n][$key] == $row[$key] && !$functions[$key] && !$field["generated"];
|
||||
$text = preg_match('~text|json|lob~', $field["type"]);
|
||||
$is_number = preg_match(number_type(), $field["type"])
|
||||
|| preg_match('~^(CHAR_LENGTH|ROUND|FLOOR|CEIL|TIME_TO_SEC|COUNT|SUM)\(~', $column)
|
||||
|| (preg_match('~^(AVG|MIN|MAX)\((.+)\)~', $column, $match) && preg_match(number_type(), $fields[idf_unescape($match[2])]["type"]))
|
||||
;
|
||||
echo "<td id='$id'" . ($is_number && ($val === null || is_numeric(strip_tags($html))) ? " class='number'" : "");
|
||||
$type = (preg_match('~^(AVG|MIN|MAX)\((.+)\)~', $column, $match) ? $fields[idf_unescape($match[2])]["type"] : $field["type"]);
|
||||
$text = preg_match('~text|json|lob~', $type);
|
||||
$is_number = preg_match(number_type(), $type) || preg_match('~^(CHAR_LENGTH|ROUND|FLOOR|CEIL|TIME_TO_SEC|COUNT|SUM)\(~', $column);
|
||||
echo "<td id='$id'" . ($is_number && ($val === null || is_numeric(strip_tags($html)) || $type == "money") ? " class='number'" : "");
|
||||
if (($_GET["modify"] && $editable && $val !== null) || $posted !== null) {
|
||||
$h_value = h($posted !== null ? $posted : $row[$key]);
|
||||
echo ">" . ($text ? "<textarea name='$id' cols='30' rows='" . (substr_count($row[$key], "\n") + 1) . "'>$h_value</textarea>" : "<input name='$id' value='$h_value' size='$lengths[$key]'>");
|
||||
|
Reference in New Issue
Block a user