diff --git a/tbl_indexes.php3 b/tbl_indexes.php3 index 7dd3190f4..0e6efa1cf 100644 --- a/tbl_indexes.php3 +++ b/tbl_indexes.php3 @@ -116,11 +116,17 @@ if (defined('PMA_IDX_INCLUDED')) { $fields_cnt = mysql_num_rows($fields_rs); } -$fields_names = array(); -$fields_types = array(); +$fields_names = array(); +$fields_types = array(); while ($row = mysql_fetch_array($fields_rs)) { - $fields_names[] = $row['Field']; - $fields_types[] = $row['Type']; + $fields_names[] = $row['Field']; + // loic1: set or enum types: slashes single quotes inside options + if (eregi('^(set|enum)\((.+)\)$', $row['Type'], $tmp)) { + $tmp[2] = substr(ereg_replace('([^,])\'\'', '\\1\\\'', ',' . $tmp[2]), 1); + $fields_types[] = $tmp[1] . '(' . str_replace(',', ', ', $tmp[2]) . ')'; + } else { + $fields_types[] = $row['Type']; + } } // end while if ($fields_rs) { diff --git a/tbl_printview.php3 b/tbl_printview.php3 index 90100a9b5..a9188a1a7 100755 --- a/tbl_printview.php3 +++ b/tbl_printview.php3 @@ -168,8 +168,7 @@ while (list($key, $table) = each($the_tables)) { // reformat mysql query output - staybyte - 9. June 2001 // loic1: set or enum types: slashes single quotes inside options if (eregi('^(set|enum)\((.+)\)$', $type, $tmp)) { - $tmp[2] = ereg_replace('([^,])\'([^,])', '\\1\\\'\\2', ',' . $tmp[2] . ','); - $tmp[2] = substr($tmp[2], 1, -1); + $tmp[2] = substr(ereg_replace('([^,])\'\'', '\\1\\\'', ',' . $tmp[2]), 1); $type = $tmp[1] . '(' . str_replace(',', ', ', $tmp[2]) . ')'; $type_nowrap = ''; } else { diff --git a/tbl_properties.inc.php3 b/tbl_properties.inc.php3 index 6655fe868..a22fbbbf8 100755 --- a/tbl_properties.inc.php3 +++ b/tbl_properties.inc.php3 @@ -90,8 +90,7 @@ for ($i = 0 ; $i < $num_fields; $i++) { // set or enum types: slashes single quotes inside options if (eregi('^(set|enum)\((.+)\)$', $type, $tmp)) { $type = $tmp[1]; - $length = ereg_replace('([^,])\'([^,])', '\\1\\\'\\2', ',' . $tmp[2] . ','); - $length = substr($length, 1, -1); + $length = substr(ereg_replace('([^,])\'\'', '\\1\\\'', ',' . $tmp[2]), 1); } else { $length = $type; $type = chop(eregi_replace('\\(.*\\)', '', $type)); diff --git a/tbl_properties.php3 b/tbl_properties.php3 index d232eabbc..37a362388 100755 --- a/tbl_properties.php3 +++ b/tbl_properties.php3 @@ -255,8 +255,7 @@ while ($row = mysql_fetch_array($fields_rs)) { // reformat mysql query output - staybyte - 9. June 2001 // loic1: set or enum types: slashes single quotes inside options if (eregi('^(set|enum)\((.+)\)$', $type, $tmp)) { - $tmp[2] = ereg_replace('([^,])\'([^,])', '\\1\\\'\\2', ',' . $tmp[2] . ','); - $tmp[2] = substr($tmp[2], 1, -1); + $tmp[2] = substr(ereg_replace('([^,])\'\'', '\\1\\\'', ',' . $tmp[2]), 1); $type = $tmp[1] . '(' . str_replace(',', ', ', $tmp[2]) . ')'; $type_nowrap = ''; } else {