diff --git a/libraries/export/texytext.php b/libraries/export/texytext.php index d248c1b605..87e5ea549e 100644 --- a/libraries/export/texytext.php +++ b/libraries/export/texytext.php @@ -252,38 +252,21 @@ if (isset($plugin_list)) { foreach ($columns as $column) { $text_output = ''; - $type = $column['Type']; - // reformat mysql query output - // set or enum types: slashes single quotes inside options - if (preg_match('/^(set|enum)\((.+)\)$/i', $type, $tmp)) { - $tmp[2] = substr(preg_replace('/([^,])\'\'/', '\\1\\\'', ',' . $tmp[2]), 1); - $type = $tmp[1] . '(' . str_replace(',', ', ', $tmp[2]) . ')'; - $type_nowrap = ''; - $binary = 0; - $unsigned = 0; - $zerofill = 0; - } else { - $type_nowrap = ' nowrap="nowrap"'; - $type = preg_replace('/BINARY/i', '', $type); - $type = preg_replace('/ZEROFILL/i', '', $type); - $type = preg_replace('/UNSIGNED/i', '', $type); - if (empty($type)) { - $type = ' '; - } - - $binary = preg_match('/BINARY/i', $column['Type']); - $unsigned = preg_match('/UNSIGNED/i', $column['Type']); - $zerofill = preg_match('/ZEROFILL/i', $column['Type']); + $extracted_fieldspec = PMA_extractFieldSpec($row['Type']); + $type = $extracted_fieldspec['print_type']; + if (empty($type)) { + $type = ' '; } + $attribute = ' '; - if ($binary) { + if ($extracted_fieldspec['binary']) { $attribute = 'BINARY'; } - if ($unsigned) { + if ($extracted_fieldspec['unsigned']) { $attribute = 'UNSIGNED'; } - if ($zerofill) { + if ($extracted_fieldspec['zerofill']) { $attribute = 'UNSIGNED ZEROFILL'; } if (! isset($column['Default'])) {