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.
This commit is contained in:
@@ -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
|
||||
?>
|
||||
|
@@ -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
|
||||
?>
|
||||
|
@@ -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
|
||||
?>
|
||||
|
@@ -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
|
||||
?>
|
||||
|
@@ -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
|
||||
?>
|
||||
|
@@ -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
|
||||
?>
|
||||
|
@@ -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
|
||||
?>
|
||||
|
@@ -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
|
||||
?>
|
||||
|
@@ -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
|
||||
?>
|
||||
|
@@ -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
|
||||
?>
|
||||
|
@@ -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<69>ge';
|
||||
$strNoRights = 'Vous n\'<27>tes pas autoris<69> <20> acc<63>der <20> 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<69>(e)s par';
|
||||
@@ -284,5 +286,4 @@ $strWelcome = 'Bienvenue
|
||||
$strWrongUser = 'Erreur d\'utilisateur/mot de passe. Acc<63>s refus<75>';
|
||||
|
||||
$strYes = 'Oui';
|
||||
$strTables=" tables "; //to translate
|
||||
?>
|
||||
|
@@ -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
|
||||
?>
|
||||
|
@@ -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
|
||||
?>
|
||||
|
@@ -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
|
||||
?>
|
||||
|
@@ -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
|
||||
?>
|
||||
|
@@ -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
|
||||
?>
|
||||
|
@@ -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
|
||||
?>
|
||||
|
@@ -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
|
||||
?>
|
||||
|
@@ -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
|
||||
?>
|
||||
|
@@ -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
|
||||
?>
|
||||
|
@@ -286,6 +286,7 @@ $strWrongUser = 'Zl
|
||||
$strYes = '<27>no';
|
||||
|
||||
// To translate
|
||||
$strNoModification = 'No change'; // To translate
|
||||
$strShowPHPInfo = 'Show PHP information'; // To translate
|
||||
$strTables=" tables "; //to translate
|
||||
$strTables = ' table(s) '; //to translate
|
||||
?>
|
||||
|
@@ -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
|
||||
?>
|
||||
|
@@ -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
|
||||
?>
|
||||
|
@@ -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
|
||||
?>
|
||||
|
@@ -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 = '<input type="hidden" name="fields_prev[' . urlencode($field) . ']" value="' . urlencode($data) . '" />';
|
||||
} else {
|
||||
$data = $special_chars = '';
|
||||
$data = $special_chars = $backup_field = '';
|
||||
}
|
||||
|
||||
// Change by Bernard M. Piller <bernard@bmpsystems.com>
|
||||
@@ -162,6 +167,7 @@ for ($i = 0; $i < mysql_num_rows($table_def); $i++) {
|
||||
if (strstr($row_table_def['True_Type'], 'text')) {
|
||||
?>
|
||||
<td>
|
||||
<?php echo $backup_field . "\n"; ?>
|
||||
<textarea name="fields[<?php echo urlencode($field); ?>]" rows="<?php echo $cfgTextareaRows; ?>" cols="<?php echo $cfgTextareaCols; ?>"><?php if (!empty($special_chars)) echo $special_chars; ?></textarea>
|
||||
</td>
|
||||
<?php
|
||||
@@ -174,19 +180,23 @@ for ($i = 0; $i < mysql_num_rows($table_def); $i++) {
|
||||
$set = str_replace('enum(', '', $row_table_def['Type']);
|
||||
$set = ereg_replace('\\)$', '', $set);
|
||||
$set = explode('\',\'', substr($set, 1, -1));
|
||||
?>
|
||||
<td>
|
||||
<input type="hidden" name="fields[<?php echo urlencode($field); ?>]" value="$enum$" />
|
||||
<?php
|
||||
echo "\n" . $backup_field . "\n";
|
||||
|
||||
// show dropdown or radio depend on length
|
||||
if (strlen($row_table_def['Type']) > 20) {
|
||||
?>
|
||||
<td>
|
||||
<select name="fields[<?php echo urlencode($field); ?>]">
|
||||
<select name="field_<?php echo md5($field); ?>[]">
|
||||
<option value=""></option>
|
||||
<?php
|
||||
echo "\n";
|
||||
|
||||
for ($j = 0; $j < count($set);$j++) {
|
||||
echo ' ';
|
||||
echo '<option value="' . $set[$j] . '"';
|
||||
echo '<option value="' . urlencode($set[$j]) . '"';
|
||||
if ($data == $set[$j]
|
||||
|| ($data == ''
|
||||
&& isset($row_table_def['Default'])
|
||||
@@ -197,18 +207,15 @@ for ($i = 0; $i < mysql_num_rows($table_def); $i++) {
|
||||
} // end for
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
<?php
|
||||
} // end if
|
||||
else {
|
||||
echo ' <td>' . "\n";
|
||||
|
||||
$seenchecked = 0;
|
||||
for ($j = 0; $j < count($set); $j++) {
|
||||
echo ' ';
|
||||
echo '<input type="radio" name="fields[' . urlencode($field) . ']" ';
|
||||
echo '<input type="radio" name="field_<?php echo md5($field); ?>[]" ';
|
||||
// echo 'value="' . substr($set[$j], 1, -1) . '"';
|
||||
echo 'value="' . $set[$j] . '"';
|
||||
echo 'value="' . urlencode($set[$j]) . '"';
|
||||
if ($data == $set[$j]
|
||||
|| ($data == ''
|
||||
&& isset($row_table_def['Default'])
|
||||
@@ -226,16 +233,18 @@ for ($i = 0; $i < mysql_num_rows($table_def); $i++) {
|
||||
|
||||
if ($row_table_def['Null'] == 'YES') {
|
||||
echo ' ';
|
||||
echo '<input type="radio" name="fields[' . urlencode($field) . ']" value="null"';
|
||||
echo '<input type="radio" name="field_<?php echo md5($field); ?>[]" value="null"';
|
||||
if ($seenchecked == 0) {
|
||||
echo ' checked="checked"';
|
||||
}
|
||||
echo ' />' . "\n";
|
||||
echo ' [' . $strNull . ']' . "\n";
|
||||
} // end if
|
||||
|
||||
echo ' </td>' . "\n";
|
||||
} // end else
|
||||
?>
|
||||
</td>
|
||||
<?php
|
||||
echo "\n";
|
||||
}
|
||||
else if (strstr($row_table_def['Type'], 'set')) {
|
||||
$set = str_replace('set(', '', $row_table_def['Type']);
|
||||
@@ -251,6 +260,7 @@ for ($i = 0; $i < mysql_num_rows($table_def); $i++) {
|
||||
$size = min(4, count($set));
|
||||
?>
|
||||
<td>
|
||||
<?php echo $backup_field . "\n"; ?>
|
||||
<input type="hidden" name="fields[<?php echo urlencode($field); ?>]" value="$set$" />
|
||||
<select name="field_<?php echo md5($field); ?>[]" size="<?php echo $size; ?>" multiple="multiple">
|
||||
<?php
|
||||
@@ -278,6 +288,7 @@ for ($i = 0; $i < mysql_num_rows($table_def); $i++) {
|
||||
?>
|
||||
<td>
|
||||
<?php echo $strBinaryDoNotEdit . "\n"; ?>
|
||||
<?php echo $backup_field . "\n"; ?>
|
||||
<input type="hidden" name="fields[<?php echo urlencode($field); ?>]" value="<?php echo $special_chars; ?>" />
|
||||
</td>
|
||||
<?php
|
||||
@@ -285,6 +296,7 @@ for ($i = 0; $i < mysql_num_rows($table_def); $i++) {
|
||||
echo "\n";
|
||||
?>
|
||||
<td>
|
||||
<?php echo $backup_field . "\n"; ?>
|
||||
<textarea name="fields[<?php echo urlencode($field); ?>]" rows="<?php echo $cfgTextareaRows; ?>" cols="<?php echo $cfgTextareaCols; ?>"><?php if (!empty($special_chars)) echo $special_chars; ?></textarea>
|
||||
</td>
|
||||
<?php
|
||||
@@ -295,6 +307,7 @@ for ($i = 0; $i < mysql_num_rows($table_def); $i++) {
|
||||
echo "\n";
|
||||
?>
|
||||
<td>
|
||||
<?php echo $backup_field . "\n"; ?>
|
||||
<input type="text" name="fields[<?php echo urlencode($field); ?>]" value="<?php echo $special_chars; ?>" size="<?php echo $fieldsize; ?>" maxlength="<?php echo $len; ?>" />
|
||||
</td>
|
||||
<?php
|
||||
|
@@ -42,7 +42,7 @@ if (isset($submit_type)) {
|
||||
|
||||
|
||||
/**
|
||||
* Prepare the update of a row
|
||||
* Prepares the update of a row
|
||||
*/
|
||||
if (isset($primary_key) && ($submit_type != $strInsertAsNewRow)) {
|
||||
// Restore the "primary key" to a convenient format
|
||||
@@ -58,12 +58,30 @@ if (isset($primary_key) && ($submit_type != $strInsertAsNewRow)) {
|
||||
while (list($key, $val) = each($fields)) {
|
||||
if ($is_encoded) {
|
||||
$key = urldecode($key);
|
||||
$val = rawurldecode($val);
|
||||
}
|
||||
|
||||
switch (strtolower($val)) {
|
||||
case 'null':
|
||||
break;
|
||||
case '$enum$':
|
||||
// if we have an enum, then construct the value
|
||||
if ($is_encoded) {
|
||||
$f = 'field_' . md5($key);
|
||||
} else {
|
||||
$f = 'field_' . $key;
|
||||
}
|
||||
if (!empty($$f)) {
|
||||
if ($$f = 'null') {
|
||||
// void
|
||||
} else if ($is_encoded) {
|
||||
$val = "'" . sql_addslashes(urldecode($$f)) . "'";
|
||||
} else {
|
||||
$val = "'" . sql_addslashes($ff) . "'";
|
||||
}
|
||||
} else {
|
||||
$val = "''";
|
||||
}
|
||||
break;
|
||||
case '$set$':
|
||||
// if we have a set, then construct the value
|
||||
if ($is_encoded) {
|
||||
@@ -72,8 +90,8 @@ if (isset($primary_key) && ($submit_type != $strInsertAsNewRow)) {
|
||||
$f = 'field_' . $key;
|
||||
}
|
||||
if (!empty($$f)) {
|
||||
if (get_magic_quotes_gpc()) {
|
||||
$val = "'" . str_replace('\\"', '"', implode(',', $$f)) . "'";
|
||||
if ($is_encoded) {
|
||||
$val = "'" . sql_addslashes(urldecode(implode(',', $$f))) . "'";
|
||||
} else {
|
||||
$val = "'" . sql_addslashes(implode(',', $$f)) . "'";
|
||||
}
|
||||
@@ -90,7 +108,12 @@ if (isset($primary_key) && ($submit_type != $strInsertAsNewRow)) {
|
||||
break;
|
||||
} // end switch
|
||||
|
||||
if (!empty($val)) {
|
||||
// No change for this column -> 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
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user