bug #1157230, escape special chars in ENUM or SET

This commit is contained in:
Marc Delisle
2005-07-23 12:02:37 +00:00
parent 8f9b686e20
commit 3b0a77bc51

View File

@@ -170,6 +170,10 @@ while ($row = PMA_DBI_fetch_assoc($fields_rs)) {
if (preg_match('@^(set|enum)\((.+)\)$@i', $type, $tmp)) { if (preg_match('@^(set|enum)\((.+)\)$@i', $type, $tmp)) {
$tmp[2] = substr(preg_replace('@([^,])\'\'@', '\\1\\\'', ',' . $tmp[2]), 1); $tmp[2] = substr(preg_replace('@([^,])\'\'@', '\\1\\\'', ',' . $tmp[2]), 1);
$type = $tmp[1] . '(' . str_replace(',', ', ', $tmp[2]) . ')'; $type = $tmp[1] . '(' . str_replace(',', ', ', $tmp[2]) . ')';
// for the case ENUM('–','“')
$type = htmlspecialchars($type);
$type_nowrap = ''; $type_nowrap = '';
$binary = 0; $binary = 0;