Do not try to set comment and MIME transformation if field not named.

This commit is contained in:
Michal Čihař
2005-10-08 17:33:20 +00:00
parent c62f975a47
commit db219629d9
4 changed files with 18 additions and 6 deletions

View File

@@ -82,7 +82,9 @@ if (isset($do_save_data)) {
// garvin: Update comment table, if a comment was set.
if (PMA_MYSQL_INT_VERSION < 40100 && isset($field_comments) && is_array($field_comments) && $cfgRelation['commwork']) {
foreach ($field_comments AS $fieldindex => $fieldcomment) {
PMA_setComment($db, $table, $field_name[$fieldindex], $fieldcomment, $field_orig[$fieldindex], 'pmadb');
if (!empty($field_name[$fieldindex])) {
PMA_setComment($db, $table, $field_name[$fieldindex], $fieldcomment, $field_orig[$fieldindex], 'pmadb');
}
}
}
@@ -127,7 +129,9 @@ if (isset($do_save_data)) {
// garvin: Update comment table for mime types [MIME]
if (isset($field_mimetype) && is_array($field_mimetype) && $cfgRelation['commwork'] && $cfgRelation['mimework'] && $cfg['BrowseMIME']) {
foreach ($field_mimetype AS $fieldindex => $mimetype) {
PMA_setMIME($db, $table, $field_name[$fieldindex], $mimetype, $field_transformation[$fieldindex], $field_transformation_options[$fieldindex]);
if (!empty($field_name[$fieldindex])) {
PMA_setMIME($db, $table, $field_name[$fieldindex], $mimetype, $field_transformation[$fieldindex], $field_transformation_options[$fieldindex]);
}
}
}