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$
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>
* 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;
for ($j = 0; $j < count($set); $j++) {
echo ' ';
echo '<input type="radio" name="field_<?php echo md5($field); ?>[]" ';
// echo 'value="' . substr($set[$j], 1, -1) . '"';
echo 'value="' . urlencode($set[$j]) . '"';
echo '<input type="radio" name="field_' . md5($field) . '[]" value="' . urlencode($set[$j]) . '"';
if ($data == $set[$j]
|| ($data == ''
&& 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') {
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) {
echo ' checked="checked"';
}

View File

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