From 7df23b47c6c598abf05108b1a09243e476cff101 Mon Sep 17 00:00:00 2001 From: "Fawzi E. Abdulfattah" Date: Sun, 14 Feb 2021 05:48:45 +0200 Subject: [PATCH] Fix #16641 - query generation bug which allowing JSON to have length Fixes: #16641 Signed-off-by: Fawzi E. Abdulfattah --- libraries/classes/Table.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/classes/Table.php b/libraries/classes/Table.php index e4c9950816..99db22dd95 100644 --- a/libraries/classes/Table.php +++ b/libraries/classes/Table.php @@ -534,7 +534,7 @@ class Table // MySQL permits a non-standard syntax for FLOAT and DOUBLE, // see https://dev.mysql.com/doc/refman/5.5/en/floating-point-types.html $pattern = '@^(DATE|TINYBLOB|TINYTEXT|BLOB|TEXT|' - . 'MEDIUMBLOB|MEDIUMTEXT|LONGBLOB|LONGTEXT|SERIAL|BOOLEAN|UUID)$@i'; + . 'MEDIUMBLOB|MEDIUMTEXT|LONGBLOB|LONGTEXT|SERIAL|BOOLEAN|UUID|JSON)$@i'; if (strlen($length) !== 0 && ! preg_match($pattern, $type)) { // Note: The variable $length here can contain several other things // besides length - ENUM/SET value or length of DECIMAL (eg. 12,3)