]> git.joonet.de Git - adminer.git/commitdiff
Do not align right non-numbers, e.g. NULL or foreign keys
authorJakub Vrana <jakub@vrana.cz>
Sun, 16 Mar 2025 08:10:43 +0000 (09:10 +0100)
committerJakub Vrana <jakub@vrana.cz>
Sun, 16 Mar 2025 08:10:43 +0000 (09:10 +0100)
adminer/select.inc.php

index 83122c6eb5ac7a0be3097a1982c28367c9ea090a..cc3a808ae56546c104733635ad5b452f7000378d 100644 (file)
@@ -453,7 +453,7 @@ if (!$columns && support("table")) {
                                                $value = $_POST["val"][$unique_idf][bracket_escape($key)];
                                                $editable = !is_array($row[$key]) && is_utf8($val) && $rows[$n][$key] == $row[$key] && !$functions[$key] && !$field["generated"];
                                                $text = preg_match('~text|json|lob~', $field["type"]);
-                                               echo "<td id='$id'" . (preg_match(number_type(), $field["type"]) ? " class='number'" : "");
+                                               echo "<td id='$id'" . (preg_match(number_type(), $field["type"]) && is_numeric(strip_tags($val)) ? " class='number'" : "");
                                                if (($_GET["modify"] && $editable) || $value !== null) {
                                                        $h_value = h($value !== null ? $value : $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]'>");