From ab4a775dd89e028a1a1b94dbdc451f37dbbd2dd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Chapeaux?= Date: Fri, 28 Dec 2001 17:26:26 +0000 Subject: [PATCH] fields with 'NULL' value were affected their default value --- ChangeLog | 2 ++ tbl_change.php3 | 8 ++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index a723c459f..cd7518582 100755 --- a/ChangeLog +++ b/ChangeLog @@ -9,6 +9,8 @@ $Source$ * lang/spanish.inc.php3: updated thanks to Gabriel Ginard . * lang/*.sh: codding standards. + * tbl_change.php3, lines 201-207: fields with "NULL" value were affected + their default value (thanks to Marc Delisle). 2001-12-27 Loïc Chapeaux * libraries/left.js, line 81: fixed bug #496491 - JS error with NS 4.73 on diff --git a/tbl_change.php3 b/tbl_change.php3 index cd2b0b3fc..d253d111a 100755 --- a/tbl_change.php3 +++ b/tbl_change.php3 @@ -198,9 +198,13 @@ for ($i = 0; $i < $fields_cnt; $i++) { echo "\n"; // Prepares the field value - if (isset($row) && isset($row[$field])) { + if (isset($row)) { + // loic1: null field value + if (!isset($row[$field])) { + $row[$field] = 'NULL'; + } // loic1: special binary "characters" - if ($is_binary || $is_blob) { + else if ($is_binary || $is_blob) { $row[$field] = str_replace("\x00", '\0', $row[$field]); $row[$field] = str_replace("\x08", '\b', $row[$field]); $row[$field] = str_replace("\x0a", '\n', $row[$field]);