From d790e421018feaee8f415b361cb411263fa23278 Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Thu, 26 May 2005 16:56:14 +0000 Subject: [PATCH] bug #1207406, undefined index from PMA_setComment --- ChangeLog | 3 +++ tbl_create.php | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index a1eb1f5d8..b227e271b 100755 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,9 @@ phpMyAdmin - Changelog $Id$ $Source$ +2005-05-26 Marc Delisle + * tbl_create.php: bug #1207406, undefined index from PMA_setComment() + 2005-05-25 Marc Delisle * tbl_properties.inc.php: bug #1207404, undefined variables diff --git a/tbl_create.php b/tbl_create.php index deb88ac9a..9e30260a3 100644 --- a/tbl_create.php +++ b/tbl_create.php @@ -200,7 +200,10 @@ if (isset($submit_num_fields)) { // garvin: Update comment table, if a comment was set. if (isset($field_comments) && is_array($field_comments) && ($cfgRelation['commwork'] || PMA_MYSQL_INT_VERSION >= 40100)) { foreach ($field_comments AS $fieldindex => $fieldcomment) { - PMA_setComment($db, $table, $field_name[$fieldindex], $fieldcomment); + // do not try to set a comment if the field name is empty + if (!empty($field_name[$fieldindex])) { + PMA_setComment($db, $table, $field_name[$fieldindex], $fieldcomment); + } } }