diff --git a/CHANGELOG.md b/CHANGELOG.md index 2ac2a7e4..fde7f249 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ - Foreign key: Display new field in case of an error - PostgreSQL: Order NULL last - PostgreSQL: Display all SQL command warnings and only once +- Editor: Display tinyint(1) as checkbox (bug #1246, regression from 5.4.2) - Croatian translation ## Adminer 5.4.2 (released 2026-02-08) diff --git a/editor/include/editing.inc.php b/editor/include/editing.inc.php index aac463ae..207f361b 100644 --- a/editor/include/editing.inc.php +++ b/editor/include/editing.inc.php @@ -43,8 +43,8 @@ function send_mail(string $email, string $subject, string $message, string $from } /** Check whether the column looks like boolean -* @param array{type: string} $field single field returned from fields() +* @param array{type: string, length?: string} $field single field returned from fields() */ function like_bool(array $field): bool { - return preg_match("~bool|bit~", $field["type"]); + return $field["type"] == "bool" || (preg_match('~bit|tinyint~', $field["type"]) && $field["length"] == 1); }