fixed some of the bugs I've introduced with my last patches

This commit is contained in:
Loïc Chapeaux
2001-08-16 09:20:48 +00:00
parent c3f87190b7
commit 95f354a0b4
3 changed files with 12 additions and 11 deletions

View File

@@ -6,7 +6,8 @@ $Id$
$Source$ $Source$
2001-08-16 Lo<4C>c Chapeaux <lolo@phpheaven.net> 2001-08-16 Lo<4C>c Chapeaux <lolo@phpheaven.net>
* tbl_replace.php3, lines 74 & 171: fixed a php syntax error. * tbl_change.php3; tbl_replace.php3: fixed some of the bugs I've introduced
with my last patches.
2001-08-15 Olivier M<>ller <om@omnis.ch> 2001-08-15 Olivier M<>ller <om@omnis.ch>
* db_details.php3: feature request #451138: display # of tables, added * db_details.php3: feature request #451138: display # of tables, added

View File

@@ -213,9 +213,7 @@ for ($i = 0; $i < mysql_num_rows($table_def); $i++) {
$seenchecked = 0; $seenchecked = 0;
for ($j = 0; $j < count($set); $j++) { for ($j = 0; $j < count($set); $j++) {
echo ' '; echo ' ';
echo '<input type="radio" name="field_<?php echo md5($field); ?>[]" '; echo '<input type="radio" name="field_' . md5($field) . '[]" value="' . urlencode($set[$j]) . '"';
// echo 'value="' . substr($set[$j], 1, -1) . '"';
echo 'value="' . urlencode($set[$j]) . '"';
if ($data == $set[$j] if ($data == $set[$j]
|| ($data == '' || ($data == ''
&& isset($row_table_def['Default']) && isset($row_table_def['Default'])
@@ -233,7 +231,7 @@ for ($i = 0; $i < mysql_num_rows($table_def); $i++) {
if ($row_table_def['Null'] == 'YES') { if ($row_table_def['Null'] == 'YES') {
echo ' '; echo ' ';
echo '<input type="radio" name="field_<?php echo md5($field); ?>[]" value="null"'; echo '<input type="radio" name="field_' . md5($field) . '[]" value="null"';
if ($seenchecked == 0) { if ($seenchecked == 0) {
echo ' checked="checked"'; echo ' checked="checked"';
} }

View File

@@ -71,12 +71,13 @@ if (isset($primary_key) && ($submit_type != $strInsertAsNewRow)) {
$f = 'field_' . $key; $f = 'field_' . $key;
} }
if (!empty($$f)) { if (!empty($$f)) {
if ($$f == 'null') { $val = implode(',', $$f);
if ($val == 'null') {
// void // void
} else if ($is_encoded) { } else if ($is_encoded) {
$val = "'" . sql_addslashes(urldecode($$f)) . "'"; $val = "'" . sql_addslashes(urldecode($val)) . "'";
} else { } else {
$val = "'" . sql_addslashes($ff) . "'"; $val = "'" . sql_addslashes($val) . "'";
} }
} else { } else {
$val = "''"; $val = "''";
@@ -168,12 +169,13 @@ else {
$f = 'field_' . $key; $f = 'field_' . $key;
} }
if (!empty($$f)) { if (!empty($$f)) {
if ($$f == 'null') { $val = implode(',', $$f);
if ($val == 'null') {
// void // void
} else if (get_magic_quotes_gpc()) { } else if (get_magic_quotes_gpc()) {
$val = "'" . str_replace('\\"', '"', implode(',', $$f)) . "'"; $val = "'" . str_replace('\\"', '"', $val) . "'";
} else { } else {
$val = "'" . sql_addslashes(implode(',', $$f)) . "'"; $val = "'" . sql_addslashes($val) . "'";
} }
} else { } else {
$val = "''"; $val = "''";