diff --git a/ChangeLog b/ChangeLog index 0db38012e..d96719d09 100755 --- a/ChangeLog +++ b/ChangeLog @@ -7,6 +7,8 @@ $Source$ 2001-08-02 Marc Delisle * tbl_qbe.php3: workaround a PHP3 problem + * tbl_change.php3: bug 446830 (enums), adapted patch + from Ignacio Vazquez-Abrams (ivazquezabrams) 2001-08-02 Benjamin Gandon * Documentation.html: added a FAQ entry about the buggy php diff --git a/tbl_change.php3 b/tbl_change.php3 index c40b88fef..a1b75a905 100755 --- a/tbl_change.php3 +++ b/tbl_change.php3 @@ -170,7 +170,7 @@ for ($i = 0; $i < mysql_num_rows($table_def); $i++) { else if (strstr($row_table_def['Type'], 'enum')) { $set = str_replace('enum(', '', $row_table_def['Type']); $set = ereg_replace('\\)$', '', $set); - $set = explode(',', $set); + $set = explode('\',\'', substr($set, 1, -1)); // show dropdown or radio depend on length if (strlen($row_table_def['Type']) > 20) { @@ -183,12 +183,14 @@ for ($i = 0; $i < mysql_num_rows($table_def); $i++) { for ($j = 0; $j < count($set);$j++) { echo ' '; - echo '' . "\n"; + echo '>' . htmlspecialchars($set[$j]) . '' . "\n"; } // end for ?> @@ -205,6 +207,7 @@ for ($i = 0; $i < mysql_num_rows($table_def); $i++) { echo 'value="' . substr($set[$j], 1, -1) . '"'; if ($data == substr($set[$j], 1, -1) || ($data == '' + && isset($row_table_def['Default']) && substr($set[$j], 1, -1) == $row_table_def['Default'] && $row_table_def['Null'] != 'YES')) { // To be able to display a checkmark in the [Null] box when