From 749d8a69039c490f7008da60e9a8c2e19362bdeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Chapeaux?= Date: Wed, 15 Aug 2001 18:07:53 +0000 Subject: [PATCH] Fixed bugs: - #444354 (Various backslash problems), - #450906 (Disappearing + in data | 2.2.0rc4), - #450374 (RC4: + becomes space), - and the one with binary data reported by Steve in the mailing-list. --- lang/brazilian_portuguese.inc.php3 | 3 +- lang/bulgarian-win1251.inc.php3 | 3 +- lang/catala.inc.php3 | 3 +- lang/chinese_big5.inc.php3 | 3 +- lang/chinese_gb.inc.php3 | 3 +- lang/czech-iso.inc.php3 | 3 +- lang/czech-win1250.inc.php3 | 3 +- lang/danish.inc.php3 | 3 +- lang/dutch.inc.php3 | 3 +- lang/english.inc.php3 | 3 +- lang/french.inc.php3 | 3 +- lang/german.inc.php3 | 3 +- lang/italian.inc.php3 | 3 +- lang/japanese.inc.php3 | 3 +- lang/korean.inc.php3 | 3 +- lang/norwegian.inc.php3 | 3 +- lang/polish.inc.php3 | 3 +- lang/portuguese.inc.php3 | 3 +- lang/russian-koi8.inc.php3 | 3 +- lang/russian-win1251.inc.php3 | 3 +- lang/slovak-iso.inc.php3 | 3 +- lang/spanish.inc.php3 | 3 +- lang/swedish.inc.php3 | 3 +- lang/thai.inc.php3 | 3 +- tbl_change.php3 | 45 ++++++++++++------- tbl_replace.php3 | 72 ++++++++++++++++++++++++++---- 26 files changed, 140 insertions(+), 49 deletions(-) diff --git a/lang/brazilian_portuguese.inc.php3 b/lang/brazilian_portuguese.inc.php3 index 7707402f2..cc5993c47 100644 --- a/lang/brazilian_portuguese.inc.php3 +++ b/lang/brazilian_portuguese.inc.php3 @@ -285,11 +285,12 @@ $strDisplayOrder = 'Display order:'; $strFieldsEmpty = ' The field count is empty! '; //to translate $strFormEmpty = 'Missing value in the form !'; $strNbRecords = 'no. of records'; +$strNoModification = 'No change'; $strOffSet = 'offset'; $strQueryOnDb = 'SQL-query on database '; $strRowSize = ' Row size '; //to translate $strShowPHPInfo = 'Show PHP information'; // To translate $strShowThisQuery = ' Show this query here again '; //to translate +$strTables = ' table(s) '; //to translate $strUseBackquotes = 'Use backquotes with tables and fields\' names'; -$strTables=" tables "; //to translate ?> diff --git a/lang/bulgarian-win1251.inc.php3 b/lang/bulgarian-win1251.inc.php3 index 57b63351f..feeba083c 100644 --- a/lang/bulgarian-win1251.inc.php3 +++ b/lang/bulgarian-win1251.inc.php3 @@ -285,11 +285,12 @@ $strDisplayOrder = 'Display order:'; $strFieldsEmpty = ' The field count is empty! '; //to translate $strFormEmpty = 'Missing value in the form !'; $strNbRecords = 'no. of records'; +$strNoModification = 'No change'; $strOffSet = 'offset'; $strQueryOnDb = 'SQL-query on database '; $strRowSize = ' Row size '; //to translate $strShowPHPInfo = 'Show PHP information'; // To translate $strShowThisQuery = ' Show this query here again '; //to translate +$strTables = ' table(s) '; //to translate $strUseBackquotes = 'Use backquotes with tables and fields\' names'; -$strTables=" tables "; //to translate ?> diff --git a/lang/catala.inc.php3 b/lang/catala.inc.php3 index 91bc43a83..0700a36e0 100644 --- a/lang/catala.inc.php3 +++ b/lang/catala.inc.php3 @@ -282,9 +282,10 @@ $strAffectedRows = 'Affected rows:'; $strDisplayOrder = 'Display order:'; $strFieldsEmpty = ' The field count is empty! '; //to translate $strFormEmpty = 'Missing value in the form !'; +$strNoModification = 'No change'; $strQueryOnDb = 'SQL-query on database '; $strShowPHPInfo = 'Show PHP information'; // To translate $strShowThisQuery = ' Show this query here again '; +$strTables = ' table(s) '; //to translate $strUseBackquotes = 'Use backquotes with tables and fields\' names'; -$strTables=" tables "; //to translate ?> diff --git a/lang/chinese_big5.inc.php3 b/lang/chinese_big5.inc.php3 index f144a8706..d5b3517dd 100644 --- a/lang/chinese_big5.inc.php3 +++ b/lang/chinese_big5.inc.php3 @@ -284,8 +284,9 @@ $strAffectedRows = ' Rows affected: '; //to translate $strDisplayOrder = 'Display order:'; $strFieldsEmpty = ' The field count is empty! '; //to translate $strFormEmpty = 'Missing value in the form !'; +$strNoModification = 'No change'; $strQueryOnDb = ' SQL-query on database '; //to translate $strShowPHPInfo = 'Show PHP information'; // To translate +$strTables = ' table(s) '; //to translate $strUseBackquotes = ' Use backquotes with tables and fields names '; //to translate -$strTables=" tables "; //to translate ?> diff --git a/lang/chinese_gb.inc.php3 b/lang/chinese_gb.inc.php3 index 2bbb66e26..8089ebcce 100644 --- a/lang/chinese_gb.inc.php3 +++ b/lang/chinese_gb.inc.php3 @@ -285,11 +285,12 @@ $strDisplayOrder = 'Display order:'; $strFieldsEmpty = ' The field count is empty! '; //to translate $strFormEmpty = 'Missing value in the form !'; $strNbRecords = 'no. of records'; +$strNoModification = 'No change'; $strOffSet = 'offset'; $strQueryOnDb = 'SQL-query on database '; $strRowSize = ' Row size '; //to translate $strShowPHPInfo = 'Show PHP information'; // To translate $strShowThisQuery = ' Show this query here again '; +$strTables = ' table(s) '; //to translate $strUseBackquotes = 'Use backquotes with tables and fields\' names'; -$strTables=" tables "; //to translate ?> diff --git a/lang/czech-iso.inc.php3 b/lang/czech-iso.inc.php3 index b4197de0d..d5cd65ebb 100644 --- a/lang/czech-iso.inc.php3 +++ b/lang/czech-iso.inc.php3 @@ -283,8 +283,9 @@ $strAffectedRows = 'Affected rows:'; $strDisplayOrder = 'Display order:'; $strFieldsEmpty = ' The field count is empty! '; //to translate $strFormEmpty = 'Missing value in the form !'; +$strNoModification = 'No change'; $strQueryOnDb = 'SQL-query on database '; $strShowPHPInfo = 'Show PHP information'; // To translate +$strTables = ' table(s) '; //to translate $strUseBackquotes = 'Use backquotes with tables and fields\' names'; -$strTables=" tables "; //to translate ?> diff --git a/lang/czech-win1250.inc.php3 b/lang/czech-win1250.inc.php3 index 89ed94cad..25a709580 100644 --- a/lang/czech-win1250.inc.php3 +++ b/lang/czech-win1250.inc.php3 @@ -283,9 +283,10 @@ $strAffectedRows = 'Affected rows:'; $strDisplayOrder = 'Display order:'; $strFieldsEmpty = ' The field count is empty! '; //to translate $strFormEmpty = 'Missing value in the form !'; +$strNoModification = 'No change'; $strQueryOnDb = 'SQL-query on database '; $strShowPHPInfo = 'Show PHP information'; // To translate $strShowThisQuery = ' Show this query here again '; //to translate +$strTables = ' table(s) '; //to translate $strUseBackquotes = 'Use backquotes with tables and fields\' names'; -$strTables=" tables "; //to translate ?> diff --git a/lang/danish.inc.php3 b/lang/danish.inc.php3 index da10057d1..f43365104 100644 --- a/lang/danish.inc.php3 +++ b/lang/danish.inc.php3 @@ -283,8 +283,9 @@ $strAffectedRows = 'Affected rows:'; $strDisplayOrder = 'Display order:'; $strFieldsEmpty = ' The field count is empty! '; //to translate $strFormEmpty = 'Missing value in the form !'; +$strNoModification = 'No change'; $strQueryOnDb = 'SQL-query on database '; $strShowPHPInfo = 'Show PHP information'; // To translate +$strTables = ' table(s) '; //to translate $strUseBackquotes = 'Use backquotes with tables and fields\' names'; -$strTables=" tables "; //to translate ?> diff --git a/lang/dutch.inc.php3 b/lang/dutch.inc.php3 index 760e4e193..f07fe3147 100644 --- a/lang/dutch.inc.php3 +++ b/lang/dutch.inc.php3 @@ -285,11 +285,12 @@ $strDisplayOrder = 'Display order:'; $strFieldsEmpty = ' The field count is empty! '; //to translate $strFormEmpty = 'Missing value in the form !'; $strNbRecords = 'no. of records'; +$strNoModification = 'No change'; $strOffSet = 'offset'; $strQueryOnDb = 'SQL-query on database '; $strRowSize = ' Row size '; //to translate $strShowPHPInfo = 'Show PHP information'; // To translate $strShowThisQuery = ' Show this query here again '; //to translate +$strTables = ' table(s) '; //to translate $strUseBackquotes = 'Use backquotes with tables and fields\' names'; -$strTables=" tables "; //to translate ?> diff --git a/lang/english.inc.php3 b/lang/english.inc.php3 index 2e2bf70d7..f918ed4b2 100644 --- a/lang/english.inc.php3 +++ b/lang/english.inc.php3 @@ -160,6 +160,7 @@ $strName = 'Name'; $strNbRecords = 'No. Of records'; $strNext = 'Next'; $strNo = 'No'; +$strNoModification = 'No change'; $strNoPassword = 'No Password'; $strNoPrivileges = 'No Privileges'; $strNoRights = 'You don\'t have enough rights to be here right now!'; @@ -252,6 +253,7 @@ $strTable = 'table '; $strTableComments = 'Table comments'; $strTableEmpty = 'The table name is empty!'; $strTableMaintenance = 'Table maintenance'; +$strTables = ' table(s) '; $strTableStructure = 'Table structure for table'; $strTableType = 'Table type'; $strTerminatedBy = 'terminated by'; @@ -284,5 +286,4 @@ $strWelcome = 'Welcome to '; $strWrongUser = 'Wrong username/password. Access denied.'; $strYes = 'Yes'; -$strTables=" tables "; //to translate ?> diff --git a/lang/french.inc.php3 b/lang/french.inc.php3 index fd38240fa..c983f78d2 100644 --- a/lang/french.inc.php3 +++ b/lang/french.inc.php3 @@ -160,6 +160,7 @@ $strName = 'Nom'; $strNbRecords = 'nb. d\'enregistrements'; $strNext = 'Suivant'; $strNo = 'Non'; +$strNoModification = 'Pas de modifications'; $strNoPassword = 'aucun mot de passe'; $strNoPrivileges = 'aucun privilège'; $strNoRights = 'Vous n\'êtes pas autorisé à accéder à cette page'; @@ -252,6 +253,7 @@ $strTable = 'table '; $strTableComments = 'Commentaires sur la table'; $strTableEmpty = 'Le nom de la table est vide'; $strTableMaintenance = 'Maintenance de la table'; +$strTables = ' table(s) '; $strTableStructure = 'Structure de la table'; $strTableType = 'Table en format'; $strTerminatedBy = 'terminé(e)s par'; @@ -284,5 +286,4 @@ $strWelcome = 'Bienvenue $strWrongUser = 'Erreur d\'utilisateur/mot de passe. Accès refusé'; $strYes = 'Oui'; -$strTables=" tables "; //to translate ?> diff --git a/lang/german.inc.php3 b/lang/german.inc.php3 index 1505430b1..413f2d74e 100644 --- a/lang/german.inc.php3 +++ b/lang/german.inc.php3 @@ -252,6 +252,7 @@ $strTable = 'Tabelle '; $strTableComments = 'Tabellen-Kommentar'; $strTableEmpty = 'Der Tabellenname ist leer!'; $strTableMaintenance = 'Hilfsmittel'; +$strTables = ' Tabellen '; $strTableStructure = 'Tabellenstruktur für Tabelle'; $strTableType = 'Tabellentyp'; $strTerminatedBy = 'getrennt mit'; @@ -286,5 +287,5 @@ $strWrongUser = 'Falscher Benutzername/Passwort. Zugriff verweigert.'; $strYes = 'Ja'; // To translate -$strTables=" Tabellen "; //to translate +$strNoModification = 'No change'; // To translate ?> diff --git a/lang/italian.inc.php3 b/lang/italian.inc.php3 index fa41a53cd..197c71664 100644 --- a/lang/italian.inc.php3 +++ b/lang/italian.inc.php3 @@ -284,8 +284,9 @@ $strAffectedRows = 'Affected rows:'; $strDisplayOrder = 'Display order:'; $strFieldsEmpty = ' The field count is empty! '; //to translate $strFormEmpty = 'Missing value in the form !'; +$strNoModification = 'No change'; // To translate $strQueryOnDb = 'SQL-query on database '; $strShowPHPInfo = 'Show PHP information'; // To translate +$strTables = ' table(s) '; //to translate $strUseBackquotes = 'Use backquotes with tables and fields\' names'; -$strTables=" tables "; //to translate ?> diff --git a/lang/japanese.inc.php3 b/lang/japanese.inc.php3 index d53e33d21..6dcb05bec 100644 --- a/lang/japanese.inc.php3 +++ b/lang/japanese.inc.php3 @@ -285,11 +285,12 @@ $strDisplayOrder = 'Display order:'; $strFieldsEmpty = ' The field count is empty! '; //to translate $strFormEmpty = 'Missing value in the form !'; $strNbRecords = 'no. of records'; +$strNoModification = 'No change'; // To translate $strOffSet = 'offset'; $strQueryOnDb = 'SQL-query on database '; $strRowSize = ' Row size '; //to translate $strShowPHPInfo = 'Show PHP information'; // To translate $strShowThisQuery = ' Show this query here again '; //to translate +$strTables = ' table(s) '; //to translate $strUseBackquotes = 'Use backquotes with tables and fields\' names'; -$strTables=" tables "; //to translate ?> diff --git a/lang/korean.inc.php3 b/lang/korean.inc.php3 index 7549ea98a..f93113fd6 100644 --- a/lang/korean.inc.php3 +++ b/lang/korean.inc.php3 @@ -285,11 +285,12 @@ $strDisplayOrder = 'Display order:'; $strFieldsEmpty = ' The field count is empty! '; //to translate $strFormEmpty = 'Missing value in the form !'; $strNbRecords = 'no. of records'; +$strNoModification = 'No change'; // To translate $strOffSet = 'offset'; $strQueryOnDb = 'SQL-query on database '; $strRowSize = ' Row size '; //to translate $strShowPHPInfo = 'Show PHP information'; // To translate $strShowThisQuery = ' Show this query here again '; //to translate +$strTables = ' table(s) '; //to translate $strUseBackquotes = 'Use backquotes with tables and fields\' names'; -$strTables=" tables "; //to translate ?> diff --git a/lang/norwegian.inc.php3 b/lang/norwegian.inc.php3 index 17250ddb6..18d113b2f 100644 --- a/lang/norwegian.inc.php3 +++ b/lang/norwegian.inc.php3 @@ -285,11 +285,12 @@ $strDisplayOrder = 'Display order:'; $strFieldsEmpty = ' The field count is empty! '; //to translate $strFormEmpty = 'Missing value in the form !'; $strNbRecords = 'no. of records'; +$strNoModification = 'No change'; // To translate $strOffSet = 'offset'; $strQueryOnDb = 'SQL-query on database '; $strRowSize = ' Row size '; //to translate $strShowPHPInfo = 'Show PHP information'; // To translate $strShowThisQuery = ' Show this query here again '; //to translate +$strTables = ' table(s) '; //to translate $strUseBackquotes = 'Use backquotes with tables and fields\' names'; -$strTables=" tables "; //to translate ?> diff --git a/lang/polish.inc.php3 b/lang/polish.inc.php3 index 50b5ad386..1c139ff92 100644 --- a/lang/polish.inc.php3 +++ b/lang/polish.inc.php3 @@ -285,6 +285,7 @@ $strWrongUser = 'Bledne pola uzytkownik/haslo. Brak dostepu.'; $strYes = 'Tak'; // To translate +$strNoModification = 'No change'; // To translate $strShowPHPInfo = 'Show PHP information'; // To translate -$strTables=" tables "; //to translate +$strTables = ' table(s) '; //to translate ?> diff --git a/lang/portuguese.inc.php3 b/lang/portuguese.inc.php3 index 58ff3ff1e..f390a086a 100644 --- a/lang/portuguese.inc.php3 +++ b/lang/portuguese.inc.php3 @@ -285,11 +285,12 @@ $strDisplayOrder = 'Display order:'; $strFieldsEmpty = ' The field count is empty! '; //to translate $strFormEmpty = 'Missing value in the form !'; $strNbRecords = 'no. of records'; +$strNoModification = 'No change'; // To translate $strOffSet = 'offset'; $strQueryOnDb = 'SQL-query on database '; $strRowSize = ' Row size '; //to translate $strShowPHPInfo = 'Show PHP information'; // To translate $strShowThisQuery = ' Show this query here again '; //to translate +$strTables = ' table(s) '; //to translate $strUseBackquotes = 'Use backquotes with tables and fields\' names'; -$strTables=" tables "; //to translate ?> diff --git a/lang/russian-koi8.inc.php3 b/lang/russian-koi8.inc.php3 index 2d4d163dc..15d8dffd2 100644 --- a/lang/russian-koi8.inc.php3 +++ b/lang/russian-koi8.inc.php3 @@ -285,6 +285,7 @@ $strAffectedRows = 'Affected rows:'; // To translate $strBzip = '"bzipped"'; // To translate $strGzip = '"gzipped"'; // To translate $strOffSet = 'offset'; // To translate +$strNoModification = 'No change'; // To translate $strShowPHPInfo = 'Show PHP information'; // To translate -$strTables=" tables "; //to translate +$strTables = ' table(s) '; //to translate ?> diff --git a/lang/russian-win1251.inc.php3 b/lang/russian-win1251.inc.php3 index a82bd2094..b91ea2657 100644 --- a/lang/russian-win1251.inc.php3 +++ b/lang/russian-win1251.inc.php3 @@ -284,7 +284,8 @@ $strYes = ' $strAffectedRows = 'Affected rows:'; // To translate $strBzip = '"bzipped"'; // To translate $strGzip = '"gzipped"'; // To translate +$strNoModification = 'No change'; // To translate $strOffSet = 'offset'; // To translate $strShowPHPInfo = 'Show PHP information'; // To translate -$strTables=" tables "; //to translate +$strTables = ' table(s) '; //to translate ?> diff --git a/lang/slovak-iso.inc.php3 b/lang/slovak-iso.inc.php3 index 65b8eacc8..b11a6953d 100644 --- a/lang/slovak-iso.inc.php3 +++ b/lang/slovak-iso.inc.php3 @@ -286,6 +286,7 @@ $strWrongUser = 'Zl $strYes = 'Áno'; // To translate +$strNoModification = 'No change'; // To translate $strShowPHPInfo = 'Show PHP information'; // To translate -$strTables=" tables "; //to translate +$strTables = ' table(s) '; //to translate ?> diff --git a/lang/spanish.inc.php3 b/lang/spanish.inc.php3 index b4ca1296a..0927173e4 100644 --- a/lang/spanish.inc.php3 +++ b/lang/spanish.inc.php3 @@ -286,7 +286,8 @@ $strAffectedRows = 'Rows affected: '; $strDisplayOrder = 'Display order:'; $strFieldsEmpty = ' The field count is empty! '; //to translate $strFormEmpty = 'Missing value in the form !'; +$strNoModification = 'No change'; // To translate $strOffSet = 'offset'; $strShowPHPInfo = 'Show PHP information'; // To translate -$strTables=" tables "; //to translate +$strTables = ' table(s) '; //to translate ?> diff --git a/lang/swedish.inc.php3 b/lang/swedish.inc.php3 index 62380e6af..a526cac95 100644 --- a/lang/swedish.inc.php3 +++ b/lang/swedish.inc.php3 @@ -285,11 +285,12 @@ $strDisplayOrder = 'Display order:'; $strFieldsEmpty = ' The field count is empty! '; //to translate $strFormEmpty = 'Missing value in the form !'; $strNbRecords = 'no. of records'; +$strNoModification = 'No change'; // To translate $strOffSet = 'offset'; $strQueryOnDb = 'SQL-query on database '; $strRowSize = ' Row size '; //to translate $strShowPHPInfo = 'Show PHP information'; // To translate $strShowThisQuery = ' Show this query here again '; //to translate +$strTables = ' table(s) '; //to translate $strUseBackquotes = 'Use backquotes with tables and fields\' names'; -$strTables=" tables "; //to translate ?> diff --git a/lang/thai.inc.php3 b/lang/thai.inc.php3 index 24902356b..f9367c190 100644 --- a/lang/thai.inc.php3 +++ b/lang/thai.inc.php3 @@ -285,11 +285,12 @@ $strDisplayOrder = 'Display order:'; $strFieldsEmpty = ' The field count is empty! '; //to translate $strFormEmpty = 'Missing value in the form !'; $strNbRecords = 'no. of records'; +$strNoModification = 'No change'; // To translate $strOffSet = 'offset'; $strQueryOnDb = 'SQL-query on database '; $strRowSize = ' Row size '; //to translate $strShowPHPInfo = 'Show PHP information'; // To translate $strShowThisQuery = ' Show this query here again '; //to translate +$strTables = ' table(s) '; //to translate $strUseBackquotes = 'Use backquotes with tables and fields\' names'; -$strTables=" tables "; //to translate ?> diff --git a/tbl_change.php3 b/tbl_change.php3 index 0a7c5a0c9..e276968d3 100755 --- a/tbl_change.php3 +++ b/tbl_change.php3 @@ -7,6 +7,14 @@ */ require('./grab_globals.inc.php3'); require('./header.inc.php3'); +if (get_magic_quotes_gpc()) { + if (!empty($sql_query)) { + $sql_query = stripslashes($sql_query); + } + if (!empty($primary_key)) { + $primary_key = stripslashes($primary_key); + } +} /** @@ -14,11 +22,7 @@ require('./header.inc.php3'); */ mysql_select_db($db); $table_def = mysql_query('SHOW FIELDS FROM ' . backquote($table)); - if (isset($primary_key)) { - if (get_magic_quotes_gpc()) { - $primary_key = stripslashes($primary_key); - } $result = mysql_query('SELECT * FROM ' . backquote($table) . ' WHERE ' . $primary_key); $row = mysql_fetch_array($result); } @@ -111,8 +115,9 @@ for ($i = 0; $i < mysql_num_rows($table_def); $i++) { if (isset($row) && isset($row[$field])) { $special_chars = htmlspecialchars($row[$field]); $data = $row[$field]; + $backup_field = ''; } else { - $data = $special_chars = ''; + $data = $special_chars = $backup_field = ''; } // Change by Bernard M. Piller @@ -162,6 +167,7 @@ for ($i = 0; $i < mysql_num_rows($table_def); $i++) { if (strstr($row_table_def['True_Type'], 'text')) { ?> + + + + 20) { ?> - - - ' . "\n"; - $seenchecked = 0; for ($j = 0; $j < count($set); $j++) { echo ' '; - echo '' . "\n"; echo ' [' . $strNull . ']' . "\n"; } // end if - - echo ' ' . "\n"; } // end else + ?> + + + + + next column + if (isset($fields_prev) && isset($fields_prev[urlencode($key)]) + && ("'" . sql_addslashes(urldecode($fields_prev[urlencode($key)])) . "'" == $val)) { + continue; + } + else if (!empty($val)) { if (empty($funcs[$key])) { $valuelist .= backquote($key) . ' = ' . $val . ', '; } else { @@ -101,12 +124,25 @@ if (isset($primary_key) && ($submit_type != $strInsertAsNewRow)) { // Builds the sql upate query $valuelist = ereg_replace(', $', '', $valuelist); - $query = 'UPDATE ' . backquote($table) . " SET $valuelist WHERE $primary_key"; + if (!empty($valuelist)) { + $query = 'UPDATE ' . backquote($table) . ' SET ' . $valuelist . ' WHERE' . $primary_key; + } + // No change -> move back to the calling script + else { + if (file_exists('./' . $goto)) { + include('./header.inc.php3'); + $message = $strNoModification; + include('./' . ereg_replace('\.\.*', '.', $goto)); + } else { + header('Location: ' . $goto); + } + exit(); + } } // end row update /** - * Prepare the insert of a row + * Prepares the insert of a row */ else { $fieldlist = ''; @@ -114,7 +150,6 @@ else { while (list($key, $val) = each($fields)) { if ($is_encoded) { $key = urldecode($key); - $val = rawurldecode($val); } // the 'query' row is urlencoded in sql.php3 else if ($key == 'query') { @@ -125,6 +160,25 @@ else { switch (strtolower($val)) { case 'null': break; + case '$enum$': + // if we have a set, then construct the value + if ($is_encoded) { + $f = 'field_' . md5($key); + } else { + $f = 'field_' . $key; + } + if (!empty($$f)) { + if ($$f = 'null') { + // void + } else if (get_magic_quotes_gpc()) { + $val = "'" . str_replace('\\"', '"', implode(',', $$f)) . "'"; + } else { + $val = "'" . sql_addslashes(implode(',', $$f)) . "'"; + } + } else { + $val = "''"; + } + break; case '$set$': // if we have a set, then construct the value if ($is_encoded) { @@ -161,7 +215,7 @@ else { // Builds the sql insert query $fieldlist = ereg_replace(', $', '', $fieldlist); $valuelist = ereg_replace(', $', '', $valuelist); - $query = 'INSERT INTO ' . backquote($table) . " ($fieldlist) VALUES ($valuelist)"; + $query = 'INSERT INTO ' . backquote($table) . ' (' . $fieldlist . ') VALUES (' . $valuelist . ')'; } // end row insertion