1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-12 09:34:10 +02:00

Don't crash when parsing overly long enum type

This commit is contained in:
Jakub Vrana
2013-07-18 13:28:35 -07:00
parent 6f6f69a891
commit b8ece2fb5d
2 changed files with 2 additions and 2 deletions

View File

@@ -152,7 +152,7 @@ function edit_type($key, $field, $collations, $foreign_keys = array()) {
*/
function process_length($length) {
global $enum_length;
return (preg_match("~^\\s*(?:$enum_length)(?:\\s*,\\s*(?:$enum_length))*\\s*\$~", $length) && preg_match_all("~$enum_length~", $length, $matches) ? implode(",", $matches[0]) : preg_replace('~[^0-9,+-]~', '', $length));
return (preg_match("~^\\s*$enum_length(?:\\s*,\\s*$enum_length)*+\\s*\$~", $length) && preg_match_all("~$enum_length~", $length, $matches) ? implode(",", $matches[0]) : preg_replace('~[^0-9,+-]~', '', $length));
}
/** Create SQL string from field type